Skip to content

Instantly share code, notes, and snippets.

@isaiah
Created February 17, 2015 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaiah/b926005d3640d49f20ab to your computer and use it in GitHub Desktop.
Save isaiah/b926005d3640d49f20ab to your computer and use it in GitHub Desktop.
scalable keyword parameter declaration
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