Skip to content

Instantly share code, notes, and snippets.

@osyo-manga
Created October 9, 2015 04:40
Show Gist options
  • Select an option

  • Save osyo-manga/d44a5133aaa47914eedd to your computer and use it in GitHub Desktop.

Select an option

Save osyo-manga/d44a5133aaa47914eedd to your computer and use it in GitHub Desktop.
super
class Base
def homu
p :base
end
end
class Derived < Base
def super
p :super
end
def homu &block
# このブロック内から super を呼び出したい
block.call
# super()
# self.super()
# p :derived
end
end
Derived.new.homu do
super()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment