Class: ROM::Repository Private
- Inherits:
-
Object
- Object
- ROM::Repository
- Defined in:
- lib/rom/repository.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A repository with a given name
and adapter
Class Method Summary collapse
-
.build(name, uri, relations = {}) ⇒ Repository
private
Build a repository with a given
name
anduri
.
Instance Method Summary collapse
-
#[](name) ⇒ Axiom::Relation
Return the relation identified by
name
. -
#[]=(name, relation) ⇒ Object
Register a relation with this repository.
Class Method Details
.build(name, uri, relations = {}) ⇒ Repository
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.
Build a repository with a given name
and uri
22 23 24 |
# File 'lib/rom/repository.rb', line 22 def self.build(name, uri, relations = {}) new(name, Axiom::Adapter.build(uri), relations) end |
Instance Method Details
#[](name) ⇒ Axiom::Relation
Return the relation identified by name
44 45 46 |
# File 'lib/rom/repository.rb', line 44 def [](name) relations.fetch(name) end |
#[]=(name, relation) ⇒ Object
Register a relation with this repository
55 56 57 58 |
# File 'lib/rom/repository.rb', line 55 def []=(name, relation) adapter[name] = relation relations[name] = adapter[name] end |