Skip to content

Instantly share code, notes, and snippets.

@wannabefro
Created March 3, 2014 21:05
Show Gist options
  • Save wannabefro/9334592 to your computer and use it in GitHub Desktop.
Save wannabefro/9334592 to your computer and use it in GitHub Desktop.
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