Created
October 27, 2012 18:38
-
-
Save telagraphic/3965616 to your computer and use it in GitHub Desktop.
Account
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Account | |
attr_accessor :balance | |
def initialize(amount) | |
@balance = 0 || amount if amount.length | |
end | |
def history | |
@history ||= Array.new | |
end | |
def history=(new_record) | |
@history ||= Array.new | |
@history.push(new_record) | |
end | |
def history_count | |
@history_count = history.count | |
end | |
def new_deposit | |
end | |
def new_debit | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment