Created
February 17, 2015 14:51
-
-
Save isaiah/b926005d3640d49f20ab to your computer and use it in GitHub Desktop.
scalable keyword parameter declaration
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
class Base | |
def xtest(foo:, bar:, **extra) | |
puts "base: #{foo}, #{bar}" | |
end | |
end | |
class Artzt < Base | |
def xtest(foo:, bar:, blah:) | |
super | |
puts "child: #{foo}, #{bar} #{blah}" | |
end | |
end | |
if __FILE__ == $0 | |
Artzt.new.xtest(foo: "foo", bar: "bar", blah: "blah") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment