Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyParentClass
- def method_
- p 'test'
- end
- end
- => :method_
- class ChildClass < DelegateClass(MyParentClass)
- end
- c = ChildClass.new(MyParentClass.new) #=> #<MyParentClass:0x007ffcaaab0280>
- c.class #=> ChildClass
- c.method_ #=> "test"
- c.respond_to?(:method_) #=> true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement