Sha256: 2e3b64be434de1c7ee9b9215e6998874b49313209cdb7ad5440aa52b80f4a3b8

Contents?: true

Size: 621 Bytes

Versions: 8

Compression:

Stored size: 621 Bytes

Contents

# frozen_string_literal: true

module Leftovers
  module Processors
    class EachKeywordArgument
      include ComparableInstance

      def initialize(then_processor)
        @then_processor = then_processor

        freeze
      end

      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

      freeze
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
leftovers-0.12.2 lib/leftovers/processors/each_keyword_argument.rb
leftovers-0.12.1 lib/leftovers/processors/each_keyword_argument.rb
leftovers-0.12.0 lib/leftovers/processors/each_keyword_argument.rb
leftovers-0.11.2 lib/leftovers/processors/each_keyword_argument.rb
leftovers-0.11.1 lib/leftovers/processors/each_keyword_argument.rb
leftovers-0.11.0 lib/leftovers/processors/each_keyword_argument.rb
leftovers-0.10.0 lib/leftovers/processors/each_keyword_argument.rb
leftovers-0.9.0 lib/leftovers/processors/each_keyword_argument.rb