Class: Temple::MutableMap

Inherits:
ImmutableMap show all
Defined in:
lib/temple/map.rb

Overview

Mutable map class which supports map merging

Direct Known Subclasses

OptionMap

Instance Method Summary collapse

Methods inherited from ImmutableMap

#[], #each, #include?, #keys, #to_hash, #values

Constructor Details

#initialize(*map) ⇒ MutableMap

Returns a new instance of MutableMap.



43
44
45
# File 'lib/temple/map.rb', line 43

def initialize(*map)
  super({}, *map)
end

Instance Method Details

#[]=(key, value) ⇒ Object



47
48
49
# File 'lib/temple/map.rb', line 47

def []=(key, value)
  @map.first[key] = value
end

#update(map) ⇒ Object



51
52
53
# File 'lib/temple/map.rb', line 51

def update(map)
  @map.first.update(map)
end