On Wed, Mar 11, 2015 at 4:00 PM, Robert Klemme
<shortcutter / googlemail.com> wrote:
> I think I prefer that solution because you can still get your Array via
> weekdays.to_a and yet do not have to materialize. This is especially
> convenient if n is large.

you are spot on as always.

but i go on a different route re coding. i dont know why. but that is
just my style maybe.
so if i would to address the op's problem, i would just plainly return
a range of days. this gives me a quick start on coding, like

  def weekdays(n = 5, start = Date.today)
    start..start+n
  end

then if am concern on processing large number of date values, i could
then "lazy" it up, like

  weekdays.lazy

then i can select wc days i want, eg

  weekdays.lazy.select{|d| !(d.saturday? || d.sunday?)}

and then probably process it

  weekdays.lazy.select{|d| !(d.saturday? || d.sunday?)}.map{|d|
d.to_s+" "+Date::DAYNAMES[d.wday]}

then i could probably process that further w #each, or stop on #force
or #to_a,  etc, etc.

in a sense,  my brain find it easy to process logic by chaining things
one at a time...  but then again, it's just for my own simple brain  :
)

best regards
--botp