apparently aliased methods are not inherited. Why is that so?
irb(main):001:0> class A
irb(main):002:1> def a; puts “A”; end
irb(main):003:1> alias :b :a
irb(main):004:1> end
nil
irb(main):005:0>
irb(main):006:0* class B
irb(main):007:1> def a; puts “B”; end
irb(main):008:1> end
nil
irb(main):009:0>
irb(main):010:0* A.new.a
A
nil
irb(main):011:0> A.new.b
A
nil
irb(main):012:0> B.new.a
B
nil
irb(main):013:0> B.new.b
NoMethodError: undefined method `b’ for #<B:0x2a525d0>
from (irb):13
irb(main):014:0>
On Thu, Jul 31, 2003 at 04:17:21PM +0900, Robert Klemme wrote:
apparently aliased methods are not inherited. Why is that so?
irb(main):001:0> class A
irb(main):002:1> def a; puts “A”; end
irb(main):003:1> alias :b :a
irb(main):004:1> end
nil
irb(main):005:0>
irb(main):006:0* class B
irb(main):007:1> def a; puts “B”; end
irb(main):008:1> end
On Thu, Jul 31, 2003 at 04:17:21PM +0900, Robert Klemme wrote:
apparently aliased methods are not inherited. Why is that so?
irb(main):001:0> class A
irb(main):002:1> def a; puts “A”; end
irb(main):003:1> alias :b :a
irb(main):004:1> end
nil
irb(main):005:0>
irb(main):006:0* class B
irb(main):007:1> def a; puts “B”; end
irb(main):008:1> end