Class: Leftovers::Processors::EachPositionalArgument
- Inherits:
-
Object
- Object
- Leftovers::Processors::EachPositionalArgument
- Includes:
- ComparableInstance
- Defined in:
- lib/leftovers/processors/each_positional_argument.rb
Instance Method Summary collapse
-
#initialize(then_processor) ⇒ EachPositionalArgument
constructor
A new instance of EachPositionalArgument.
- #process(_str, current_node, matched_node, acc) ⇒ Object
Methods included from ComparableInstance
Constructor Details
#initialize(then_processor) ⇒ EachPositionalArgument
Returns a new instance of EachPositionalArgument.
8 9 10 11 12 |
# File 'lib/leftovers/processors/each_positional_argument.rb', line 8 def initialize(then_processor) @then_processor = then_processor freeze end |
Instance Method Details
#process(_str, current_node, matched_node, acc) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/leftovers/processors/each_positional_argument.rb', line 14 def process(_str, current_node, matched_node, acc) positional_arguments = current_node.positional_arguments return unless positional_arguments positional_arguments.each do |argument_node| @then_processor.process(argument_node.to_literal_s, argument_node, matched_node, acc) end end |