Method: Ab::Indexer::Randomizer::OneEight#rand

Defined in:
lib/ab/indexer.rb

#rand(value) ⇒ Object



63
64
65
66
67
68
69
70
71
# File 'lib/ab/indexer.rb', line 63

def rand(value)
  if value.kind_of?(Range)
    first = value.first
    last = value.last - first
    return Kernel::rand(last) + first
  else
    Kernel::rand(value)
  end
end