Skip to content

morashid92/bank_account

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 

Repository files navigation

Ruby BankAccount class

To work with this program, enter these commands in terminal:

WITH INSTANCE METHODS
irb

irb > load './bank_account.rb'

irb > bank_account = BankAccount.new("Mohammed", "Rashid")

irb > ap bank_account.inspect
INTRODUCING CLASS METHODS

irb > load './bank_account.rb'

irb > BankAccount.create_for("Mohammed", "Rashid")

irb > BankAccount.create_for("Mike", "The frog")

#Create as many as you like!

#Now Go into Any one of the accounts using find_for and deposit using bank_account.deposit(100) for that account

irb > bank_account.balance
INTRODUCING METHOD VISIBILITY
irb > load './bank_account.rb'

irb > bank_account.reset!

# create another method call_the_reset_method

irb > load './bank_account.rb'

irb > bank_account.call_the_reset_method

irb > account1 = BankAccount.new("Jason", "Seifer")

irb > account2 = BankAccount.new("Mike", "The Frog")

irb > account1.reset_other_balance(account2)

About

OOP with BankAccount class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages