Dynamically chain class methods

Hi all,

I was wondering if it is possible to dynamically chain class methods in rails. Suppose there are several optional methods that a class may have, I want to chain call all the methods that apply to a certain class. Is it possible? What is the best approach to do achieve this?

Thanks in advance.

Hi all,

I was wondering if it is possible to dynamically chain class methods in rails. Suppose there are several optional methods that a class may have, I want to chain call all the methods that apply to a certain class. Is it possible? What is the best approach to do achieve this?

ActiveSupport::Callbacks ?

Fred

ActiveSupport defined Module#alias_method_chain which is used extensively to do what I think you are asking for.

Googling alias_method_chain should fill you in on the details.