Skip to content

Instantly share code, notes, and snippets.

@inem
Created April 12, 2009 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inem/93947 to your computer and use it in GitHub Desktop.
Save inem/93947 to your computer and use it in GitHub Desktop.
I wish I could do something like this
class User
def fullname(first, second)
"#{this.firstname} #{first} whatever"
end
def address(options)
"#{street} #{options[:hash_key]}"
end
def smth(params)
"*#{params}*"
end
end
user.to_json(:methods => {
:fullname => ["text parameter", some_var],
:address => {:hash_key => :value},
:smth => "one text parameter"
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment