3 ms·
> It is true that all message responses (including accessors) are implemented using methods. An object can respond to a message even though it doesn't have a m
by epidemian 12y ago
> It is true that all message responses (including accessors) are implemented using methods.
An object can respond to a message even though it doesn't have a method with that name. A classic example are Rails' dynamic finders:
User.methods.include?(:find_by_name)
=> false
User.respond_to?(:find_by_name)
=> true
- dragonwriter 12y ago> An object can respond to a message even though it doesn't have a method with that name. Sure, by using a different method (method_missing); its still all method calls.
- throwaway0010 12y agoYes and the responses are implemented with methods. Always.