Module: RubyExtendsions::HashExtendsions::InstanceMethods

Defined in:
lib/hash_extendsions.rb,
lib/ruby_extendsions/hash_extendsions.rb

Instance Method Summary collapse

Instance Method Details

#hash_reverseObject



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

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