Skip to content

Instantly share code, notes, and snippets.

@rachidcalazans
Last active March 22, 2018 17:20
Show Gist options
  • Save rachidcalazans/6c173502a1d169b29b3e8549a2504738 to your computer and use it in GitHub Desktop.
Save rachidcalazans/6c173502a1d169b29b3e8549a2504738 to your computer and use it in GitHub Desktop.
Example VI Avoiding Nil - Represent special cases as objects
class GuestUser
def authenticated?
false
end
end
class User
def authenticated?
true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment