Class: Smith::Budget::Reservation

Inherits:
Object
  • Object
show all
Defined in:
lib/smith/budget/reservation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ledger_identity:, token:, amounts:) ⇒ Reservation

Returns a new instance of Reservation.



8
9
10
11
12
13
# File 'lib/smith/budget/reservation.rb', line 8

def initialize(ledger_identity:, token:, amounts:)
  @ledger_identity = ledger_identity
  @token = token
  @amounts = amounts.dup.freeze
  freeze
end

Instance Attribute Details

#amountsObject (readonly)

Returns the value of attribute amounts.



6
7
8
# File 'lib/smith/budget/reservation.rb', line 6

def amounts
  @amounts
end

Instance Method Details

#identity_for(ledger_identity) ⇒ Object



15
16
17
# File 'lib/smith/budget/reservation.rb', line 15

def identity_for(ledger_identity)
  @token if @ledger_identity.equal?(ledger_identity)
end