Skip to content

Instantly share code, notes, and snippets.

@simonjefford
Created October 23, 2014 09:59
Show Gist options
  • Save simonjefford/519c6205f0cfc976ec58 to your computer and use it in GitHub Desktop.
Save simonjefford/519c6205f0cfc976ec58 to your computer and use it in GitHub Desktop.
super
class Base
attr_reader :foo
def initialize
@foo = 42
end
end
class Super < Base
attr_reader :bar
def initialize(bar)
super()
@bar = bar
end
end
s = Super.new("BAR")
puts s.foo
puts s.bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment