Class: ROM::Repository::Root
- Inherits:
-
ROM::Repository
- Object
- ROM::Repository
- ROM::Repository::Root
- Defined in:
- lib/rom/repository/root.rb
Overview
A specialized repository type dedicated to work with a root relation
This repository type builds commands and aggregates for its root relation
Constant Summary
Constants inherited from ROM::Repository
Instance Attribute Summary collapse
- #root ⇒ Object readonly
Attributes inherited from ROM::Repository
#auto_struct, #container, #relations, #struct_namespace
Class Method Summary collapse
-
.inherited(klass) ⇒ Object
private
Sets descendant root relation.
-
.root ⇒ Object
Get or set repository root relation identifier.
Instance Method Summary collapse
-
#initialize ⇒ Root
constructor
A new instance of Root.
Methods inherited from ROM::Repository
auto_struct, #inspect, relation_reader, #transaction
Methods included from ClassInterface
#[], #commands, #inherited, #new, #use
Constructor Details
#initialize ⇒ Root
Returns a new instance of Root.
59 60 61 62 |
# File 'lib/rom/repository/root.rb', line 59 def initialize(*) super @root = set_relation(self.class.root) end |
Instance Attribute Details
Class Method Details
.inherited(klass) ⇒ Object
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.
Sets descendant root relation
53 54 55 56 |
# File 'lib/rom/repository/root.rb', line 53 def self.inherited(klass) super klass.root(root) end |
.root ⇒ Symbol .root(identifier) ⇒ Symbol
Get or set repository root relation identifier
This method is automatically used when you define a class using MyRepo shortcut
44 |
# File 'lib/rom/repository/root.rb', line 44 defines :root |