class Hash

add shuffle Hash class

Public Instance Methods

shuffle() click to toggle source
# File class/suggest_class.rb, line 17
def shuffle
  Hash[self.to_a.sample(self.length)]
end
shuffle!() click to toggle source
# File class/suggest_class.rb, line 21
def shuffle!
  self.replace(self.shuffle)
end