Sha256: e61324e99996b421095f94de522eadb4aa1fa78a289043d0856684416dbfa84a

Contents?: true

Size: 519 Bytes

Versions: 18

Compression:

Stored size: 519 Bytes

Contents

module Dry
  module Mutations
    module Transactions # :nodoc:
      # rubocop:disable Style/MultilineTernaryOperator
      Container = lambda do |whatever|
        return ->(*input) { input } unless whatever
        whatever.respond_to?(:call) ? whatever : Utils.Constant(whatever).tap do |p|
          fail ArgumentError, "The argument must respond to :call, though #{whatever.inspect} passed." unless p.respond_to? :call
        end
      end
      # rubocop:enable Style/MultilineTernaryOperator
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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