Well, I tried a lot of different things and i am really stuck after trying a lot of different ways to transfer "money" from one account to another. I just deleted everything I made myself, because it was totally not doing what I wanted.
Firstly, what i thought is that you could write down the first part like a withdrawal. But how do you tell the method to add the ammount to the other account? Secondly, the second part could be written down as a deposit. Basically this last step is what I couldn't find out!
I hope some genius Rubyist can help me out?
def transfer(pin_number, amount) if pin_number == pin @balance -= amount #What should be coded here to add the amount subtracted from "account1" #after starting the transfer as followed: account1.transfer(pin_number, amount) #and add this amount to "account2"? end
I would be gratefull!