Module: Tins::ProcCompose
- Included in:
- Proc
- Defined in:
- lib/tins/proc_compose.rb
Instance Method Summary collapse
- #compose(other) ⇒ Object (also: #*)
Instance Method Details
#compose(other) ⇒ Object Also known as: *
3 4 5 6 7 8 9 10 11 |
# File 'lib/tins/proc_compose.rb', line 3 def compose(other) self.class.new do |*args| if other.respond_to?(:call) call(*other.call(*args)) else call(*other.to_proc.call(*args)) end end end |