Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/symbiont.rb
Instance Method Summary collapse
Instance Method Details
#call_method_chain(method_chain, arg = nil) ⇒ Object
95 96 97 98 99 100 101 102 103 104 |
# File 'lib/symbiont.rb', line 95 def call_method_chain(method_chain, arg = nil) return self if method_chain.empty? method_chain.split('.').inject(self) do |o, m| if arg.nil? o.send(m.intern) else o.send(m.intern, arg) end end end |