Simplified to_json method API

39 views
Skip to first unread message

Bogdan Gusiev

unread,
Jan 7, 2013, 1:50:26 PM1/7/13
to rubyonra...@googlegroups.com
Sometimes to_json options feels abusing to me:

user.to_json(:only => [:id, :name], :methods => [:something])


I would prefer an API like this instead:

user.to_json(:id, :name, :something)

What do you think about adding a use case like this to to_json?
Reply all
Reply to author
Forward
0 new messages