honor common to_json method signature


Fixes #1772
add ruby filter spec


Fixes #1772