alias_method_chain

>> class A
>>   def foo
>>     puts "old foo"
>>   end
>>   def foo_with_feature
>>     puts "new foo"
>>   end
>>   alias_method_chain :foo, :feature
>> end
=> A
>> a = A.new
=> #
>> a.foo
new foo
=> nil
>> a.foo_with_feature
new foo
=> nil
>> a.foo_without_feature
old foo
=> nil


Leave a Reply

Formatting: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>