Skip to content

Instantly share code, notes, and snippets.

@cjameshuff
Created July 1, 2013 18:47
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 cjameshuff/5903469 to your computer and use it in GitHub Desktop.
Save cjameshuff/5903469 to your computer and use it in GitHub Desktop.
Pseudo-Smalltalk/named parameters syntax in Ruby
class Thing
def do_something(params)
puts "#{params[:a]}, #{params[:b]}, #{params[:c]}"
end # do_something()
end # class Thing
myThing = Thing.new
myThing.do_something(a: 3.14159, b: 2.71828, c: 1.618033)
(myThing.do_something a: 3.14159, b: 2.71828, c: 1.618033)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment