class Range

Some extentions to the core Range class

Public Instance Methods

generate(*_args) click to toggle source

Randomly generate a value within the range

# File lib/ext_core.rb, line 173
def generate(*_args)
  if first.is_a? Numeric and last.is_a? Numeric
    Faker::Number.between(first, last)
  else
    to_a.sample
  end
end