Module: WGObjectExtensions
- Included in:
- Object
- Defined in:
- lib/wice_grid_core_ext.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#deep_send(*messages) ⇒ Object
takes a list of messages, sends message 1 to self, then message 2 is sent to the result of the first message, ans so on returns nil as soon as the current receiver does not respond to such a message.
Instance Method Details
#deep_send(*messages) ⇒ Object
takes a list of messages, sends message 1 to self, then message 2 is sent to the result of the first message, ans so on returns nil as soon as the current receiver does not respond to such a message
137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/wice_grid_core_ext.rb', line 137 def deep_send(*) #:nodoc: obj = self .each do || if obj.respond_to? obj = obj.send() else return nil end # return obj if obj.nil? end return obj end |