Sha256: f3beebd422ed17bd6d56286b992abab3e6b8e75021c2f04bd970a99d4fbe5849

Contents?: true

Size: 369 Bytes

Versions: 8

Compression:

Stored size: 369 Bytes

Contents

module ROM
  module HTTP
    module Commands
      class Create < ROM::Commands::Create
        adapter :http

        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

8 entries across 8 versions & 1 rubygems

Version Path
rom-http-0.4.0 lib/rom/http/commands/create.rb
rom-http-0.3.0 lib/rom/http/commands/create.rb
rom-http-0.2.0 lib/rom/http/commands/create.rb
rom-http-0.2.0.beta1 lib/rom/http/commands/create.rb
rom-http-0.1.2 lib/rom/http/commands/create.rb
rom-http-0.1.1 lib/rom/http/commands/create.rb
rom-http-0.1.0 lib/rom/http/commands/create.rb
rom-http-0.0.1 lib/rom/http/commands/create.rb