Class: ROM::Memory::Relation
- Includes:
- Enumerable, ROM::Memory
- Defined in:
- core/lib/rom/memory/relation.rb
Overview
Relation subclass for memory adapter
Instance Attribute Summary collapse
- #__memoized__ ⇒ Object included from ROM::Memoizable readonly private
- #relation_name ⇒ Object included from Relation::ClassInterface readonly
- #schema_proc ⇒ Object included from Relation::ClassInterface readonly private
Instance Method Summary collapse
-
#delete(*args) ⇒ Relation
Delete tuples from the relation.
-
#insert(*args) ⇒ Relation
(also: #<<)
Insert tuples into the relation.
- #join(*args) ⇒ Relation
- #order(*fields) ⇒ Relation
-
#project(*names) ⇒ Memory::Relation
Project a relation with provided attribute names.
-
#rename(mapping) ⇒ Object
Rename attributes in a relation.
- #restrict(criteria = nil) ⇒ Relation
- #take(amount) ⇒ Relation
Instance Attribute Details
#__memoized__ ⇒ Object (readonly) Originally defined in module ROM::Memoizable
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
#relation_name ⇒ Object (readonly) Originally defined in module Relation::ClassInterface
#schema_proc ⇒ Object (readonly) Originally defined in module Relation::ClassInterface
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Instance Method Details
#delete(*args) ⇒ Relation
Delete tuples from the relation
84 85 86 87 |
# File 'core/lib/rom/memory/relation.rb', line 84 def delete(*args) dataset.delete(*args) self end |
#insert(*args) ⇒ Relation Also known as: <<
Insert tuples into the relation
69 70 71 72 |
# File 'core/lib/rom/memory/relation.rb', line 69 def insert(*args) dataset.insert(*args) self end |
#join(*args) ⇒ Relation
41 |
# File 'core/lib/rom/memory/relation.rb', line 41 forward :take, :join, :restrict, :order |
#order(*fields) ⇒ Relation
41 |
# File 'core/lib/rom/memory/relation.rb', line 41 forward :take, :join, :restrict, :order |
#project(*names) ⇒ Memory::Relation
Project a relation with provided attribute names
50 51 52 |
# File 'core/lib/rom/memory/relation.rb', line 50 def project(*names) schema.project(*names).(self) end |
#rename(mapping) ⇒ Object
Rename attributes in a relation
57 58 59 |
# File 'core/lib/rom/memory/relation.rb', line 57 def rename(mapping) schema.rename(mapping).(self) end |
#restrict(criteria = nil) ⇒ Relation
41 |
# File 'core/lib/rom/memory/relation.rb', line 41 forward :take, :join, :restrict, :order |
#take(amount) ⇒ Relation
41 |
# File 'core/lib/rom/memory/relation.rb', line 41 forward :take, :join, :restrict, :order |