Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Account
- ## has a balance / return the balance (get/set)
- #
- attr_accessor :balance
- attr_accessor :bank
- ## has a label
- #
- attr_accessor :label
- def initialize(label)
- self.label = label
- self.balance = 0.0
- self
- end
- ##
- # deposit funds
- def deposit(amount)
- self.bank.deposit(amount, self)
- end
- ##
- # withdraw funds
- def withdraw(amount)
- self.bank.withdraw(amount, self)
- end
- end
Add Comment
Please, Sign In to add comment