Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/symbiote/data_setter.rb
Instance Method Summary collapse
Instance Method Details
#chain(method_chain, arg = nil) ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/symbiote/data_setter.rb', line 2 def 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 |