Skip to content

Instantly share code, notes, and snippets.

@adamyeats-zz
Last active April 17, 2018 20:07
Show Gist options
  • Save adamyeats-zz/6976689 to your computer and use it in GitHub Desktop.
Save adamyeats-zz/6976689 to your computer and use it in GitHub Desktop.
Keyword Arguments in Ruby
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