Skip to content

Instantly share code, notes, and snippets.

@telagraphic
Created October 27, 2012 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save telagraphic/3965616 to your computer and use it in GitHub Desktop.
Save telagraphic/3965616 to your computer and use it in GitHub Desktop.
Account
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