Module: Stunted::Chainable
- Defined in:
- lib/stunted/chaining.rb
Instance Method Summary collapse
Instance Method Details
#defsend(*args, &block) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/stunted/chaining.rb', line 31 def defsend(*args, &block) if block_given? instance_exec(*args, &block) else fn = args.shift instance_exec(*args, &fn) end end |
#pass_to(*args, &block) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/stunted/chaining.rb', line 22 def pass_to(*args, &block) if block_given? lambda(&block).(self, *args) else fn = args.shift fn.(self, *args) end end |