Skip to content

Instantly share code, notes, and snippets.

@youngbrioche
Created March 21, 2012 11:23
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 youngbrioche/2146301 to your computer and use it in GitHub Desktop.
Save youngbrioche/2146301 to your computer and use it in GitHub Desktop.
puts RUBY_VERSION
class Foo
def info(*args)
puts args.inspect
end
end
class Bar < Foo
def info(*args)
puts "BEFORE"
super
puts "AFTER"
end
end
Foo.new.info "foo", "bar", "baz"
Bar.new.info "foo", "bar", "baz"
# 1.8.7
# ["foo", "bar", "baz"]
# BEFORE
# ["foo", "bar", "baz"]
# AFTER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment