Skip to content

Instantly share code, notes, and snippets.

@edward
Created December 24, 2013 03:55
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 edward/8108608 to your computer and use it in GitHub Desktop.
Save edward/8108608 to your computer and use it in GitHub Desktop.
Example of destructuring in Ruby
class Whatever
def ohai(message: nil, times: nil)
message * times
end
end
Whatever.new.ohai({times: 3, message: 'yep'}) # => "yepyepyep"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment