Class: ROM::Memory::Relation
- Includes:
- Enumerable, ROM::Memory
- Defined in:
- lib/rom/memory/relation.rb
Overview
Relation subclass for memory adapter
Constant Summary
Constants inherited from Relation
Constants included from Relation::ClassInterface
Relation::ClassInterface::DEFAULT_DATASET_PROC, Relation::ClassInterface::INVALID_RELATIONS_NAMES
Constants included from ROM::Memoizable
ROM::Memoizable::MEMOIZED_HASH
Instance Attribute Summary
Attributes inherited from Relation
#auto_map, #auto_struct, #commands, #dataset, #input_schema, #mappers, #meta, #name, #output_schema, #schema, #struct_namespace
Attributes included from Relation::ClassInterface
Attributes included from ROM::Memoizable
Instance Method Summary collapse
-
#delete(*args) ⇒ Relation
Delete tuples from the relation.
-
#insert(*args) ⇒ Relation
(also: #<<)
Insert tuples into the relation.
-
#project(*names) ⇒ Memory::Relation
Project a relation with provided attribute names.
-
#rename(mapping) ⇒ Object
Rename attributes in a relation.
Methods inherited from Relation
#[], #adapter, #as, #associations, #attr_ast, auto_map, #auto_map?, auto_struct, #auto_struct?, #call, #combine, #combine_with, #curried?, #each, #eager_load, #foreign_key, gateway, #gateway, #graph?, #map_to, #map_with, #mapper, #meta_ast, #new, #node, #nodes, #preload_assoc, #schema?, #schemas, struct_namespace, #to_a, #to_ast, #with, #wrap, #wrap?, #wrap_around
Methods included from Initializer
Methods included from Relation::ClassInterface
#[], #curried, #dataset, #default_name, #default_schema, #forward, #mapper_registry, #name, #relation_name, #schema, #schemas, #set_schema!, #use, #view, #view_methods
Methods included from Notifications::Listener
Methods included from AutoCurry
#auto_curried_methods, #auto_curry, #auto_curry_busy?, #auto_curry_guard, extended
Methods included from Pipeline
Methods included from Pipeline::Operator
Methods included from Relation::Materializable
#each, #first, #one, #one!, #to_a
Methods included from ROM::Memoizable
Methods included from Relation::Commands
Instance Method Details
#delete(*args) ⇒ Relation
Delete tuples from the relation
63 64 65 66 |
# File 'lib/rom/memory/relation.rb', line 63 def delete(*args) dataset.delete(*args) self end |
#insert(*args) ⇒ Relation Also known as: <<
Insert tuples into the relation
48 49 50 51 |
# File 'lib/rom/memory/relation.rb', line 48 def insert(*args) dataset.insert(*args) self end |
#project(*names) ⇒ Memory::Relation
Project a relation with provided attribute names
29 30 31 |
# File 'lib/rom/memory/relation.rb', line 29 def project(*names) schema.project(*names).(self) end |
#rename(mapping) ⇒ Object
Rename attributes in a relation
36 37 38 |
# File 'lib/rom/memory/relation.rb', line 36 def rename(mapping) schema.rename(mapping).(self) end |