Module: RubyExtendsions::HashExtendsions::InstanceMethods

Defined in:
lib/ruby_extendsions/hash_extendsions.rb

Instance Method Summary collapse

Instance Method Details

#hash_reverseObject



9
10
11
12
13
14
15
# File 'lib/ruby_extendsions/hash_extendsions.rb', line 9

def hash_reverse
  hash_new = {}
  self.each {|key,value|
    if not hash_new.has_key?(key) then hash_new[value] = key end
  }
  return hash_new
end