Class: SaveTheMonth::ExpectedBalance
- Inherits:
-
Object
- Object
- SaveTheMonth::ExpectedBalance
- Defined in:
- lib/expected_balance.rb
Instance Attribute Summary collapse
-
#final_date ⇒ Object
Returns the value of attribute final_date.
-
#initial_amount ⇒ Object
Returns the value of attribute initial_amount.
-
#initial_date ⇒ Object
Returns the value of attribute initial_date.
-
#movements ⇒ Object
Returns the value of attribute movements.
-
#periodical_strategies ⇒ Object
Returns the value of attribute periodical_strategies.
Instance Method Summary collapse
- #add_charge(name, &perform) ⇒ Object
- #add_payment(name, &perform) ⇒ Object
- #add_timed_charge(name, amount, date) ⇒ Object
- #add_timed_payment(name, amount, date) ⇒ Object
-
#initialize ⇒ ExpectedBalance
constructor
A new instance of ExpectedBalance.
Constructor Details
#initialize ⇒ ExpectedBalance
Returns a new instance of ExpectedBalance.
50 51 52 53 |
# File 'lib/expected_balance.rb', line 50 def initialize self.movements = [] self.periodical_strategies = PaymentPeriodicalStrategies.new end |
Instance Attribute Details
#final_date ⇒ Object
Returns the value of attribute final_date.
48 49 50 |
# File 'lib/expected_balance.rb', line 48 def final_date @final_date end |
#initial_amount ⇒ Object
Returns the value of attribute initial_amount.
48 49 50 |
# File 'lib/expected_balance.rb', line 48 def initial_amount @initial_amount end |
#initial_date ⇒ Object
Returns the value of attribute initial_date.
48 49 50 |
# File 'lib/expected_balance.rb', line 48 def initial_date @initial_date end |
#movements ⇒ Object
Returns the value of attribute movements.
48 49 50 |
# File 'lib/expected_balance.rb', line 48 def movements @movements end |
#periodical_strategies ⇒ Object
Returns the value of attribute periodical_strategies.
48 49 50 |
# File 'lib/expected_balance.rb', line 48 def periodical_strategies @periodical_strategies end |
Instance Method Details
#add_charge(name, &perform) ⇒ Object
55 56 57 |
# File 'lib/expected_balance.rb', line 55 def add_charge(name, &perform) movements << make_movement(:charge, name, &perform) end |
#add_payment(name, &perform) ⇒ Object
59 60 61 |
# File 'lib/expected_balance.rb', line 59 def add_payment(name, &perform) movements << make_movement(:payment, name, &perform) end |
#add_timed_charge(name, amount, date) ⇒ Object
67 68 69 |
# File 'lib/expected_balance.rb', line 67 def add_timed_charge(name, amount, date) movements << make_timed_movement(name, amount, date) end |
#add_timed_payment(name, amount, date) ⇒ Object
63 64 65 |
# File 'lib/expected_balance.rb', line 63 def add_timed_payment(name, amount, date) movements << make_timed_movement(name, -amount, date) end |