Skip to content

Instantly share code, notes, and snippets.

@rachidcalazans
Last active March 22, 2018 17:20
Show Gist options
  • Save rachidcalazans/c033806270340f045dc5c5f5d079073e to your computer and use it in GitHub Desktop.
Save rachidcalazans/c033806270340f045dc5c5f5d079073e to your computer and use it in GitHub Desktop.
Example III Avoiding Nil - Represent special cases as objects
class GuestUser
def posts
List.public_posts # Exactly same method that took the Conditional Controller.
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment