Class: ROM::Memory::Relation
- Includes:
- Enumerable, ROM::Memory
- Defined in:
- lib/rom/memory/relation.rb
Overview
Relation subclass for memory adapter
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 Method Details
#delete(*args) ⇒ Relation
Delete tuples from the relation
85 86 87 88 |
# File 'lib/rom/memory/relation.rb', line 85 def delete(*args) dataset.delete(*args) self end |
#insert(*args) ⇒ Relation Also known as: <<
Insert tuples into the relation
70 71 72 73 |
# File 'lib/rom/memory/relation.rb', line 70 def insert(*args) dataset.insert(*args) self end |
#join(*args) ⇒ Relation
42 |
# File 'lib/rom/memory/relation.rb', line 42 forward :take, :join, :restrict, :order |
#order(*fields) ⇒ Relation
42 |
# File 'lib/rom/memory/relation.rb', line 42 forward :take, :join, :restrict, :order |
#project(*names) ⇒ Memory::Relation
Project a relation with provided attribute names
51 52 53 |
# File 'lib/rom/memory/relation.rb', line 51 def project(*names) schema.project(*names).(self) end |
#rename(mapping) ⇒ Object
Rename attributes in a relation
58 59 60 |
# File 'lib/rom/memory/relation.rb', line 58 def rename(mapping) schema.rename(mapping).(self) end |
#restrict(criteria = nil) ⇒ Relation
42 |
# File 'lib/rom/memory/relation.rb', line 42 forward :take, :join, :restrict, :order |
#take(amount) ⇒ Relation
42 |
# File 'lib/rom/memory/relation.rb', line 42 forward :take, :join, :restrict, :order |