Skip to content

Instantly share code, notes, and snippets.

@jeremyf
Created June 19, 2015 12:40
Show Gist options
  • Save jeremyf/d46ab570f38b570cd257 to your computer and use it in GitHub Desktop.
Save jeremyf/d46ab570f38b570cd257 to your computer and use it in GitHub Desktop.
Silly
DEFAULT_POWER = 10
def exponent(integer, power: DEFAULT_POWER, **keywords)
integer ** power
end
puts exponent(10, power: 2)
puts exponent(10)
def another(integer, *args, key:, **keywords)
exponent(integer, **keywords)
end
puts another(10, :b, "hello", key: :value, another_key: :hello)
puts another(2, nil, 5, key: nil, power: 7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment