call parent class method without super()

Run Settings
LanguageRuby
Language Version
Run Command
class A; def a() 42 end end class B < A; def a() 24 end end class B def b # call A#a => 42, instead of 24 from B#a self.class.superclass.instance_method(:a).bind(self).call # self.class => B # B.superclass => C # C.instance_method(:a) => unbound_method(:a), can not `call' # unbound_method(:a).bind(self) => method(:a), can be `call' now end end p B.new.b
Editor Settings
Theme
Key bindings
Full width
Lines