On Mar 4, 2015, at 8:32 AM, Daniel Loureiro <loureirorg@gmail.com> wrote:
>
> Hi everyone,
>
> it's a silly question (and I'm kind of ashamed to ask it), but I frequently must do things like that:
>
> a.present? ? a : b
a.presence || b
<http://api.rubyonrails.org/classes/Object.html#method-i-presence>
--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/65CA78F2-522D-4D4D-B6DD-A1F399C06142%40elevated-dev.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment