Created
September 5, 2013 15:38
-
-
Save sirramongabriel/6451866 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # account.rb | |
| require_relative 'banking.rb' | |
| require_relative 'interact.rb' | |
| class Account | |
| def initialize(balance, amount) | |
| @amount = Banking.new(interact, amount) | |
| @balance = 1000.00 | |
| end | |
| attr_accessor :amount | |
| def withdraw(amount) | |
| Self.balance - amount | |
| puts "You chose to withdraw #{amount} from your account." | |
| puts "Your new balance is #{Self.balance}" | |
| end | |
| def deposit(amount, balance) | |
| Self.balance += @amount | |
| puts "You chose to deposit #{amount} into your account." | |
| puts "Your new balance is #{Self.balance}" | |
| end | |
| ramrod = Account.new(amount, balance) | |
| ramrod.balance | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment