>From the source comments actually, so {} and "   " too...

# "", "   ", nil, [], and {} are blank

On 8/30/06, Andrew Kaspick <[EMAIL PROTECTED]> wrote:
> blank? handles []
>
> class Array #:nodoc:
>   alias_method :blank?, :empty?
> end
>
> On 8/30/06, Kevin Clark <[EMAIL PROTECTED]> wrote:
> >
> > Does .blank? handle [] as well as "" and nil? I was going to use
> > .empty? but then I'd have to check that the method existed.
> >
> > On 8/29/06, Jarkko Laine <[EMAIL PROTECTED]> wrote:
> > >
> > > On 30.8.2006, at 8.43, Kevin Clark wrote:
> > >
> > > >
> > > >> You'd then also have to add a find! and document this in both the
> > > >> dynamic finders section of the docs as well as the find! method.
> > > >
> > > >
> > > > def find!(*args)
> > > >   val = find(*args)
> > > >   raise blah if val.nil? or (val == [])
> > >
> > > val.blank?, man ;-)
> > >
> > > >   return val
> > > > end
> > > >
> > > > Or something like that. I wrote it in gmail so it isn't tested.
> > > >
> > > > --
> > > > Kevin Clark
> > > > http://glu.ttono.us
> > > >
> > > > > >
> > >
> > > --
> > > Jarkko Laine
> > > http://jlaine.net
> > > http://odesign.fi
> > >
> > >
> > >
> > >
> >
> >
> > --
> > Kevin Clark
> > http://glu.ttono.us
> >
> > > >
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core
-~----------~----~----~----~------~----~------~--~---

Reply via email to