Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on True, False And Nil Objects In Ruby.
[shell] ./script/console Loading development environment (Rails 2.3.3) >> nil.blank? => true >> "".blank? => true >> [].blank? => true >> {}.blank? => true
instead of
if myobj && myobj.size == 0 then :blah end
you can write
if myobj.blank? then :blah end
makes me miss perl though
There are no comments on this comment yet.
instead of
if myobj && myobj.size == 0 then :blah end
you can write
if myobj.blank? then :blah end
makes me miss perl though