Class: VER::Keymap::MapHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/ver/keymap.rb

Overview

A subclass to make lookup unambigous

Instance Method Summary collapse

Instance Method Details

#deep_each(&block) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/ver/keymap.rb', line 57

def deep_each(&block)
  if block
    each do |key, value|
      if value.respond_to?(:deep_each)
        value.deep_each(&block)
      else
        yield key, value
      end
    end
  else
    Enumerator.new(self, :deep_each)
  end
end

#deep_merge(other) ⇒ Object



75
76
77
# File 'lib/ver/keymap.rb', line 75

def deep_merge(other)
  merge(other, &MERGER)
end

#deep_merge!(other) ⇒ Object



71
72
73
# File 'lib/ver/keymap.rb', line 71

def deep_merge!(other)
  replace(merge(other, &MERGER))
end