lib/garcon/core_ext/random.rb
# Returns a copy of the hash with _values_ arranged in new random order.
#
# @example
#   h = {:a=>1, :b=>2, :c=>3}
#   h.shuffle  # => {:b=>2, :c=>1, :a>3}
#
Returns a copy of the hash with _values_ arranged in new random order.
Returns a copy of the hash with _values_ arranged in new random order .
def shuffle
      ::Hash.zip(
        keys.sort_by   { SecureRandom.random_number },
        values.sort_by { SecureRandom.random_number })
    end
def shuffle :: Hash . zip ( keys . sort_by { SecureRandom . random_number } , values . sort_by { SecureRandom . random_number } ) end
Returns a copy of the hash with _values_ arranged in new random order.
Returns a copy of the hash with _values_ arranged in new random order .
example
None