Skip to content

Instantly share code, notes, and snippets.

@jjuarez
Created September 26, 2013 10:39
Show Gist options
  • Save jjuarez/6712504 to your computer and use it in GitHub Desktop.
Save jjuarez/6712504 to your computer and use it in GitHub Desktop.
This cook works well for default parameters
class YourClass
DEFAUL_PARAMETER_VALUE = :foo
def your_method(parameter, options={ })
options = { :default_parameter =>DEFAULT_PARAMETER_VALUE }.merge(options)
# Do something with this
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment