Sha256: def8b7d651f1a7d5a53de68ba21051f6661036efdd5ad53682f75efcbf0da3bb

Contents?: true

Size: 935 Bytes

Versions: 36

Compression:

Stored size: 935 Bytes

Contents

module Dry
  module Mutations
    module Extensions
      module Sieve # :nodoc:
        def execute
          inputs
        end
      end

      module Pipe # :nodoc:
        def execute
          case
          when respond_to?(:raw_inputs) then raw_inputs
          when instance_variable_defined?(:@raw_inputs) then instance_variable_get(:@raw_inputs)
          else inputs
          end
        end
      end

      module Hole # :nodoc:
        def self.prepended base
          base.class_eval { schema(input_processor: :noop) }
        end
        singleton_class.send :alias_method, :included, :prepended
      end

      # rubocop:disable Style/ConstantName
      Dummy = ENV['USE_SIEVE_AS_DUMMY'] ? Sieve : Pipe
      # rubocop:enable Style/ConstantName

      module Wrapper # :nodoc:
        def execute
          { Utils.Snake(self.class, short: true, symbolize: true) => super }
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
dry-mutations-1.6.0 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.5.7 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.5.6 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.5.5 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.5.4 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.5.3 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.5.2 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.5.1 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.5.0 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.3.6 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.3.5 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.3.4 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.3.3 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.3.2 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.3.1 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.1.3 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.1.1 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.1.0 lib/dry/mutations/extensions/dummy.rb
dry-mutations-1.0.0 lib/dry/mutations/extensions/dummy.rb
dry-mutations-0.99.100 lib/dry/mutations/extensions/dummy.rb