Class: Upgrow::BasicRepository
- Inherits:
-
Object
- Object
- Upgrow::BasicRepository
- Defined in:
- lib/upgrow/basic_repository.rb
Overview
Base class for Repositories. It offers a basic API for the state all Repositories should have, as well as the logic on how to materialize data into Models.
Direct Known Subclasses
Class Attribute Summary collapse
-
.base ⇒ Object
the base object to be used internally to retrieve the persisted data.
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
Instance Method Summary collapse
-
#initialize ⇒ BasicRepository
constructor
Sets the Basic Repositorie’s state.
Constructor Details
#initialize ⇒ BasicRepository
Sets the Basic Repositorie’s state.
28 29 30 |
# File 'lib/upgrow/basic_repository.rb', line 28 def initialize @base = self.class.base end |
Class Attribute Details
.base ⇒ Object
the base object to be used internally to retrieve the persisted data. For example, a base class in which queries can be performed for a relational database adapter. Defaults to ‘nil`.
16 17 18 |
# File 'lib/upgrow/basic_repository.rb', line 16 def base @base || default_base end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
25 26 27 |
# File 'lib/upgrow/basic_repository.rb', line 25 def base @base end |