Skip to content

Instantly share code, notes, and snippets.

@isaiah
Created February 17, 2015 14:51
Show Gist options
  • Select an option

  • Save isaiah/b926005d3640d49f20ab to your computer and use it in GitHub Desktop.

Select an option

Save isaiah/b926005d3640d49f20ab to your computer and use it in GitHub Desktop.

Revisions

  1. isaiah created this gist Feb 17, 2015.
    17 changes: 17 additions & 0 deletions keyword_param.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    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