Sha256: 8df9cb1d941a5953c97651174d08a4b10cf8e93654e4497d9732b1d2e41545ba

Contents?: true

Size: 520 Bytes

Versions: 1

Compression:

Stored size: 520 Bytes

Contents

module ROM
  module HTTP
    module Commands
      #  HTTP Create command
      #
      #  @api public
      class Create < ROM::Commands::Create
        adapter :http

        # Submits each of the provided tuples over HTTP post
        #
        # @api public
        def execute(tuples)
          Array([tuples]).flatten.map do |tuple|
            attributes = input[tuple]
            validator.call(attributes)
            relation.insert(attributes.to_h)
          end.to_a
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rom-http-0.5.0 lib/rom/http/commands/create.rb