Skip to content

Instantly share code, notes, and snippets.

@sirramongabriel
Created September 5, 2013 15:38
Show Gist options
  • Select an option

  • Save sirramongabriel/6451866 to your computer and use it in GitHub Desktop.

Select an option

Save sirramongabriel/6451866 to your computer and use it in GitHub Desktop.
# 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