Hi --

On Wed, 21 Feb 2007, ara.t.howard / noaa.gov wrote:

> i'd use something like
>
>  def unless_cached pathname
>    yield unless File.exist?(pathname)
>  end
>
>  def download
>  end
>
>  domains.each do |domain|
>    unless_cached(domain) do
>      download
>    end
>  end

I'm curious what that buys you over and above:

   unless File.exist?(domain)

or even:

   def cached(pathname)
     File.exist?(pathname)
   end

   ...
     unless cached(domain)
   ...

Is there a downside to just using unless raw (so to speak)?


David

-- 
Q. What is THE Ruby book for Rails developers?
A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black)
    (See what readers are saying!  http://www.rubypal.com/r4rrevs.pdf)
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)