Class: OneUp::User
- Inherits:
-
Object
- Object
- OneUp::User
- Defined in:
- lib/one_up/user.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #give(gift, to:, message:) ⇒ Object
-
#initialize(name:, ledger:) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(name:, ledger:) ⇒ User
Returns a new instance of User.
4 5 6 7 |
# File 'lib/one_up/user.rb', line 4 def initialize(name:, ledger:) @name = name @ledger = ledger end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/one_up/user.rb', line 3 def name @name end |
Instance Method Details
#give(gift, to:, message:) ⇒ Object
9 10 11 |
# File 'lib/one_up/user.rb', line 9 def give(gift, to:, message:) @ledger.add_entry(giver: self, receiver: to, gift: gift, message: ) end |