Sha256: 233103f421e4b19577b645e8926457ade38aaa7e9e1869d9eee2502e786ca699
Contents?: true
Size: 707 Bytes
Versions: 10
Compression:
Stored size: 707 Bytes
Contents
# frozen-string-literal: true module Leftovers module ValueProcessors class EachForDefinitionSet def initialize(then_processors) @then_processors = then_processors freeze end def process(str, node, method_node) definitions = @then_processors.map do |then_processor| processed = then_processor.process(str, node, method_node) return if processed == :keep # rubocop:disable Lint/NonLocalExitFromIterator processed end definitions.flatten! definitions.compact! return definitions.first if definitions.length <= 1 ::Leftovers::DefinitionSet.new(definitions) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems