Created
July 1, 2013 18:47
-
-
Save cjameshuff/5903469 to your computer and use it in GitHub Desktop.
Pseudo-Smalltalk/named parameters syntax in Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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