Skip to content

Instantly share code, notes, and snippets.

@mjc
Last active August 29, 2015 14:03
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 mjc/f6502e8097ba019340f9 to your computer and use it in GitHub Desktop.
Save mjc/f6502e8097ba019340f9 to your computer and use it in GitHub Desktop.
class A
def bar(*blah)
blah
end
end
class Foo < A
def bar(*)
no_commands { super }
end
def no_commands
yield
end
end
class Baz < A
def bar(*)
super
end
end
puts Foo.new.bar(:name).inspect
# jruby 1.7.13:
# => [:name]
# jruby 207df03
# => [[:name]]
puts Baz.new.bar(:name).inspect
# both
# [:name]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment