class Array

Public Instance Methods

swap_indexes(a,b) click to toggle source
# File lib/core_extensions.rb, line 57
def swap_indexes(a,b)
  temp = self.dup
  temp[a], temp[b] = temp[b], temp[a]
  temp
end
swap_indexes!(a,b) click to toggle source
# File lib/core_extensions.rb, line 63
def swap_indexes!(a,b)
  self[a], self[b] = self[b], self[a]
  self
end
to_h() click to toggle source
# File lib/core_extensions.rb, line 53
def to_h
  Hash[self]
end
uniq?() click to toggle source
# File lib/core_extensions.rb, line 49
def uniq?
  length == uniq.length
end