Class: Repositor::Base
- Inherits:
-
Object
- Object
- Repositor::Base
- Defined in:
- lib/repositor/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
-
#initialize(model: nil) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(model: nil) ⇒ Base
Returns a new instance of Base.
7 8 9 |
# File 'lib/repositor/base.rb', line 7 def initialize(model: nil) @model = model || self.class.to_s.chomp(self.class::TYPE).singularize.constantize end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
5 6 7 |
# File 'lib/repositor/base.rb', line 5 def model @model end |