Skip to content

Instantly share code, notes, and snippets.

@patricksrobertson
Last active August 31, 2015 17:27
Show Gist options
  • Save patricksrobertson/27d0ebfa698e1dbbb1ce to your computer and use it in GitHub Desktop.
Save patricksrobertson/27d0ebfa698e1dbbb1ce to your computer and use it in GitHub Desktop.
class PinVerifier
attr_reader :user
def initialize(user)
@user = user || NullVerifier.new
end
def valid?(pin)
user.valid_pin?(pin)
end
private
class NullVerifier
def valid_pin?(pin);false;end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment