Sha256: 764b1b3d5288550ba28deba269eb5fb9eca9a765523574d338528c566e053ff0

Contents?: true

Size: 714 Bytes

Versions: 4

Compression:

Stored size: 714 Bytes

Contents

require 'rom/plugins/relation/schema'

module ROM
  module HTTP
    class Relation < ROM::Relation
      include Enumerable

      adapter :http
      use :schema

      forward :with_request_method, :with_path, :append_path, :with_options,
              :with_params, :clear_params, :project

      def initialize(*)
        super
        dataset.response_transformer(
          Dataset::ResponseTransformers::Schemad.new(self.class.schema)
        ) if self.class.schema
      end

      def insert(*args)
        dataset.insert(*args)
      end
      alias_method :<<, :insert

      def update(*args)
        dataset.update(*args)
      end

      def delete
        dataset.delete
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rom-http-0.4.0 lib/rom/http/relation.rb
rom-http-0.3.0 lib/rom/http/relation.rb
rom-http-0.2.0 lib/rom/http/relation.rb
rom-http-0.2.0.beta1 lib/rom/http/relation.rb