Class: Deposit
- Inherits:
-
Object
- Object
- Deposit
- Defined in:
- lib/vendra/domain/models/entities/deposit/deposit.rb
Instance Attribute Summary collapse
-
#cache_pieces ⇒ Object
Returns the value of attribute cache_pieces.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(repository) ⇒ Deposit
constructor
A new instance of Deposit.
- #insert(value) ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(repository) ⇒ Deposit
Returns a new instance of Deposit.
26 27 28 |
# File 'lib/vendra/domain/models/entities/deposit/deposit.rb', line 26 def initialize(repository) @repository = repository end |
Instance Attribute Details
#cache_pieces ⇒ Object
Returns the value of attribute cache_pieces.
24 25 26 |
# File 'lib/vendra/domain/models/entities/deposit/deposit.rb', line 24 def cache_pieces @cache_pieces end |
Class Method Details
.instance ⇒ Object
3 4 5 |
# File 'lib/vendra/domain/models/entities/deposit/deposit.rb', line 3 def instance @instance ||= (find || create) end |
Instance Method Details
#insert(value) ⇒ Object
30 31 32 33 34 |
# File 'lib/vendra/domain/models/entities/deposit/deposit.rb', line 30 def insert(value) cache_piece = CachePiece.new(value) cache_pieces << cache_piece update end |
#update ⇒ Object
36 37 38 |
# File 'lib/vendra/domain/models/entities/deposit/deposit.rb', line 36 def update repository.update(self) end |