Sha256: fbaf52aedbcd90cc5f8ee3dfdcaf027425f6664dc12aef12f34b94519a7a4121
Contents?: true
Size: 647 Bytes
Versions: 1
Compression:
Stored size: 647 Bytes
Contents
# frozen_string_literal: true module Leftovers module ValueProcessors class Keyword def initialize(matcher, then_processor) @matcher = matcher @then_processor = then_processor freeze end def process(_str, node, method_node) kwargs = node.kwargs return unless kwargs Leftovers.map_or_self(kwargs.children) do |pair| next unless @matcher === pair argument_node = pair.first str = argument_node.to_s if argument_node.string_or_symbol? @then_processor.process(str, argument_node, method_node) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
leftovers-0.8.0 | lib/leftovers/value_processors/keyword.rb |