Last active
April 17, 2018 20:07
-
-
Save adamyeats-zz/6976689 to your computer and use it in GitHub Desktop.
Keyword Arguments in Ruby
This file contains hidden or 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
def my_method(thing, string: "bacon") | |
[thing, string] | |
end | |
puts my_method("chunky") #=> [chunky, bacon] | |
puts my_method("awesome", string: "chocolate") #=> [awesome, chocolate] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment