Skip to content

Instantly share code, notes, and snippets.

@johno
Created July 8, 2013 21:32
Show Gist options
  • Save johno/5952694 to your computer and use it in GitHub Desktop.
Save johno/5952694 to your computer and use it in GitHub Desktop.
Clean up some ternary statements.
device["signal_strength"] == nil ? '0' : device["signal_strength"]
# You can also can use the following:
device['signal_strength'] || 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment