Class: Owemegod::Person
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Owemegod::Person
- Defined in:
- lib/owemegod/person.rb
Instance Attribute Summary collapse
-
#expenses ⇒ Object
Returns the value of attribute expenses.
Instance Method Summary collapse
- #add_expense(name, amount) ⇒ Object
-
#initialize(*args) ⇒ Person
constructor
A new instance of Person.
- #total_expenses ⇒ Object
Constructor Details
#initialize(*args) ⇒ Person
Returns a new instance of Person.
8 9 10 11 |
# File 'lib/owemegod/person.rb', line 8 def initialize(*args) super self.expenses = ExpenseCollection.new end |
Instance Attribute Details
#expenses ⇒ Object
Returns the value of attribute expenses.
6 7 8 |
# File 'lib/owemegod/person.rb', line 6 def expenses @expenses end |
Instance Method Details
#add_expense(name, amount) ⇒ Object
17 18 19 |
# File 'lib/owemegod/person.rb', line 17 def add_expense(name, amount) expenses.add_expense(name, amount) end |
#total_expenses ⇒ Object
21 22 23 |
# File 'lib/owemegod/person.rb', line 21 def total_expenses expenses.value end |