There was an error while loading. Please reload this page.
class Foo def self.inherited(child) child.singleton_class.define_singleton_method(:receives) do |name, &block| define_method(name) do |*args| puts "yes I added this code here first!!!!" block.call *args end end end end class Bar < Foo class << self receives(:surprise!) {'surprise!'} end end puts Bar.surprise!