Class: OneUp::LedgerRepository
- Inherits:
-
Object
- Object
- OneUp::LedgerRepository
- Extended by:
- Mixins::ActsAsCrud
- Defined in:
- lib/one_up/ledger.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#gift ⇒ Object
Returns the value of attribute gift.
-
#giver ⇒ Object
Returns the value of attribute giver.
-
#message ⇒ Object
Returns the value of attribute message.
-
#receiver ⇒ Object
Returns the value of attribute receiver.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(giver:, receiver:, gift:, message:, created_at: Time.now) ⇒ LedgerRepository
constructor
A new instance of LedgerRepository.
Methods included from Mixins::ActsAsCrud
all, create, crud_element_list, crud_element_list=, delete_all
Constructor Details
#initialize(giver:, receiver:, gift:, message:, created_at: Time.now) ⇒ LedgerRepository
Returns a new instance of LedgerRepository.
6 7 8 9 10 11 12 |
# File 'lib/one_up/ledger.rb', line 6 def initialize(giver:, receiver:, gift:, message:, created_at: Time.now) @giver = giver @receiver = receiver @gift = gift = @created_at = created_at end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
5 6 7 |
# File 'lib/one_up/ledger.rb', line 5 def created_at @created_at end |
#gift ⇒ Object
Returns the value of attribute gift.
5 6 7 |
# File 'lib/one_up/ledger.rb', line 5 def gift @gift end |
#giver ⇒ Object
Returns the value of attribute giver.
5 6 7 |
# File 'lib/one_up/ledger.rb', line 5 def giver @giver end |
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/one_up/ledger.rb', line 5 def end |
#receiver ⇒ Object
Returns the value of attribute receiver.
5 6 7 |
# File 'lib/one_up/ledger.rb', line 5 def receiver @receiver end |
Class Method Details
.entries_from_range(today_start, today_end) ⇒ Object
14 15 16 |
# File 'lib/one_up/ledger.rb', line 14 def self.entries_from_range(today_start, today_end) all.select { |e| (today_start..today_end).cover? e.created_at } end |