Class: Range

Inherits:
Object show all
Defined in:
lib/choose.rb

Instance Method Summary collapse

Instance Method Details

#choose(generator = nil) ⇒ Object



74
75
76
77
78
79
80
81
# File 'lib/choose.rb', line 74

def choose ( generator=nil )
  case first
  when Integer
    first + (last + 1 - first).choose(generator)
  else
    super(nil, generator)
  end
end