Skip to content

Instantly share code, notes, and snippets.

@nzifnab
Created May 4, 2011 22:16
Show Gist options
  • Save nzifnab/956156 to your computer and use it in GitHub Desktop.
Save nzifnab/956156 to your computer and use it in GitHub Desktop.
update_amount method
def update_amount(amt, change_type)
if change_type == 'Withdraw'
self.amount -= amt
elsif change_type == 'Deposit'
self.amount += amt
else
raise ArgumentError.new("Unknown type #{change_type} when altering account funds.")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment