A program that allows a user to interact with a virutal Automatic Teller Machine
This project is a small game that uses classes to enable gameplay, We are learning Ruby and using RSpec for testing and our pushes go via Tranvis and Coveralls to se if everything is working as it should.
We are learning Ruby and RSpec, this excercise made sense to implement and practice the skills we've learnd so far.
Clone or donwload the repo and load the files in your terminal with irb.
atm-demo
load './lib/atm-demo.rb'
=> true
person
load './lib/person.rb'
=> true
account.rb is loaded via person.rb and atm-demo.rb so there's no need to load it seperatly.
Create a new person
person = Person.new(:name 'Aiden')
=> person
Create a new ATM
atm = ATM.new
=> atm
Create a new account
account = person.create_accout(:owner person)
=> account
Make a deposit
Specify the ammout you wish to withdraw, the ATM has $1000 on initialize.
person.deposit(100)
=> 100
Make a withdrawl
Specify the ammout, add your own pin (it's probalby not '1234'), add your account-name and the name of the atm.
person.withdraw(amount: 100, pin: 1234, account: account, atm: atm)
=> 100
You can check to se how much cash the person has, how much funds is in the ATM and see you account-balalce.
Cash
person.cash
=> 500
Balance
account.balance
=> 500
Funds
atm.funds
=> 1000