Created
March 3, 2014 21:05
-
-
Save wannabefro/9334592 to your computer and use it in GitHub Desktop.
This file contains 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
class Account | |
def initialize(pin) | |
@pin = pin | |
end | |
def can_access?(pin) | |
@pin == pin | |
end | |
def change_pin(pin, new_pin) | |
if can_access?(pin) | |
@pin = new_pin | |
puts "Pin successfully changed" | |
else | |
puts "Go away you dirty hacker" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment