lib/garcon/core_ext/random.rb
# Return a random element from the range.
#
# @example
#   (1..4).at_rand           # => 2
#   (1..4).at_rand           # => 4
#
#   (1.5..2.5).at_rand       # => 2.06309842754533
#   (1.5..2.5).at_rand       # => 1.74976944931541
#
#   ('a'..'z').at_rand       # => 'q'
#   ('a'..'z').at_rand       # => 'f'
#
# @return [String]
#   A random element from range
#
# @api public
Return a random element from the range.
Return a random element from the range .
def at_rand
      first, last = first(), last()
      if first.respond_to?(:random_delta)
        begin
          first.random_delta(last, exclude_end?)
        rescue
          to_a.at_rand
        end
      else
        to_a.at_rand
      end
    end
def at_rand first , last = first ( ) , last ( ) if first . respond_to? ( :random_delta ) begin first . random_delta ( last , exclude_end? ) rescue to_a . at_rand end else to_a . at_rand end end
Return a random element from the range.
Return a random element from the range .
A random element from range
A random element from range
String
example
None
api
None