Skip to content

Instantly share code, notes, and snippets.

@somebox
Created September 13, 2013 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save somebox/6553626 to your computer and use it in GitHub Desktop.
Save somebox/6553626 to your computer and use it in GitHub Desktop.
>> h={a:true,b:false,c:1}
=> {:a=>true, :b=>false, :c=>1}
>> h[:a].present?
=> true
>> h[:a].presence
=> true
>> h[:b].present?
=> false
>> h[:b].presence
=> nil
>> h[:c].present?
=> true
>> h[:c].presence
=> 1
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment