Class: CallableTree::Node::Internal::Strategy::Compose
- Inherits:
-
Object
- Object
- CallableTree::Node::Internal::Strategy::Compose
- Includes:
- CallableTree::Node::Internal::Strategy
- Defined in:
- lib/callable_tree/node/internal/strategy/compose.rb
Instance Method Summary collapse
Methods included from CallableTree::Node::Internal::Strategy
Instance Method Details
#call(nodes, *inputs, **options) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/callable_tree/node/internal/strategy/compose.rb', line 10 def call(nodes, *inputs, **) head, *tail = inputs nodes.reduce(head) do |input, node| inputs = [input, *tail] if node.match?(*inputs, **) node.call(*inputs, **) else input end end end |