Class: Leftovers::Processors::EachKeywordArgument
- Inherits:
-
Object
- Object
- Leftovers::Processors::EachKeywordArgument
- Includes:
- ComparableInstance
- Defined in:
- lib/leftovers/processors/each_keyword_argument.rb
Instance Method Summary collapse
-
#initialize(then_processor) ⇒ EachKeywordArgument
constructor
A new instance of EachKeywordArgument.
- #process(_str, current_node, matched_node, acc) ⇒ Object
Methods included from ComparableInstance
Constructor Details
#initialize(then_processor) ⇒ EachKeywordArgument
Returns a new instance of EachKeywordArgument.
8 9 10 11 12 |
# File 'lib/leftovers/processors/each_keyword_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 23 24 |
# File 'lib/leftovers/processors/each_keyword_argument.rb', line 14 def process(_str, current_node, matched_node, acc) kwargs = current_node.kwargs return unless kwargs kwargs.children.each do |pair| next unless pair.type == :pair value_node = pair.second @then_processor.process(value_node.to_literal_s, value_node, matched_node, acc) end end |