Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
graywh
on Dec 12, 2012
|
parent
|
context
|
favorite
| on:
Github Ruby Styleguide
That's a good example
shirt.blue? and return bar
would be equivalent to
return bar if shirt.blue?
You can do the same with
or
and
unless
.
philwelch
on Dec 12, 2012
[–]
I find the postfix if and unless far more readable than the Perlish and and or operators. The "or die" construction for asserts is really amusing though.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: