Sha256: db194f7ddfb595ed722cdfb68b53194d8be8eadb349d7ddfda1c07e401770c08

Contents?: true

Size: 855 Bytes

Versions: 7

Compression:

Stored size: 855 Bytes

Contents

module ROM
  module Memory
    # Relation subclass for memory adapter
    #
    # @example
    #   class Users < ROM::Relation[:memory]
    #   end
    #
    # @api public
    class Relation < ROM::Relation
      include Enumerable

      forward :join, :project, :restrict, :order

      # Insert tuples into the relation
      #
      # @example
      #   users.insert(name: 'Jane')
      #
      # @return [Relation]
      #
      # @api public
      def insert(*args)
        dataset.insert(*args)
        self
      end
      alias_method :<<, :insert

      # Delete tuples from the relation
      #
      # @example
      #   users.insert(name: 'Jane')
      #   users.delete(name: 'Jane')
      #
      # @return [Relation]
      #
      # @api public
      def delete(*args)
        dataset.delete(*args)
        self
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rom-0.6.2 lib/rom/memory/relation.rb
rom-0.6.1 lib/rom/memory/relation.rb
rom-0.6.0 lib/rom/memory/relation.rb
rom-0.6.0.rc1 lib/rom/memory/relation.rb
rom-0.6.0.beta3 lib/rom/memory/relation.rb
rom-0.6.0.beta2 lib/rom/memory/relation.rb
rom-0.6.0.beta1 lib/rom/memory/relation.rb