class Hash

Public Instance Methods

method_missing(m, *args, &block) click to toggle source
# File lib/cxxproject/ext/hash.rb, line 2
def method_missing(m, *args, &block)
  if m.to_s =~ /(.*)=$/ # was assignment
    self[$1] = args[0]
  else
    fetch(m.to_s, nil)
  end
end
recursive_merge(h) click to toggle source
# File lib/cxxproject/ext/hash.rb, line 9
def recursive_merge(h)
  self.merge!(h) {|key, _old, _new| if _old.class == Hash then _old.recursive_merge(_new) else _new end  }
end