Sha256: 392ca5d70e1bf840c7d6f28209534ac21f2a98f9f22031d92da57caf94381cc9

Contents?: true

Size: 696 Bytes

Versions: 12

Compression:

Stored size: 696 Bytes

Contents

# frozen-string-literal: true

module Leftovers
  module ProcessorBuilders
    module TransformChain
      def self.build(transforms, next_transform) # rubocop:disable Metrics/MethodLength
        case transforms
        when ::Hash
          transforms.reverse_each do |(transform, transform_arg)|
            next_transform = ::Leftovers::ProcessorBuilders::Transform.build(
              transform, transform_arg, next_transform
            )
          end
          next_transform
        when ::String
          ::Leftovers::ProcessorBuilders::Transform.build(transforms, true, next_transform)
        # :nocov:
        else raise
          # :nocov:
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
leftovers-0.7.0 lib/leftovers/processor_builders/transform_chain.rb
leftovers-0.6.0 lib/leftovers/processor_builders/transform_chain.rb
leftovers-0.5.5 lib/leftovers/processor_builders/transform_chain.rb
leftovers-0.5.4 lib/leftovers/processor_builders/transform_chain.rb
leftovers-0.5.3 lib/leftovers/processor_builders/transform_chain.rb
leftovers-0.5.2 lib/leftovers/processor_builders/transform_chain.rb
leftovers-0.5.1 lib/leftovers/processor_builders/transform_chain.rb
leftovers-0.5.0 lib/leftovers/processor_builders/transform_chain.rb
leftovers-0.4.3 lib/leftovers/processor_builders/transform_chain.rb
leftovers-0.4.2 lib/leftovers/processor_builders/transform_chain.rb
leftovers-0.4.1 lib/leftovers/processor_builders/transform_chain.rb
leftovers-0.4.0 lib/leftovers/processor_builders/transform_chain.rb