Class: DiviningRod::Mash

Inherits:
Hash
  • Object
show all
Defined in:
lib/divining_rod/mash.rb

Instance Method Summary collapse

Constructor Details

#initialize(hsh = {}) ⇒ Mash

Returns a new instance of Mash.



4
5
6
# File 'lib/divining_rod/mash.rb', line 4

def initialize(hsh = {})
  self.replace(hsh || {})
end

Instance Method Details

#merge(opts) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/divining_rod/mash.rb', line 8

def merge(opts)
  opts = opts.dup
  if self[:tags] || opts[:tags]
    tags = Array(self[:tags]) | Array(opts[:tags])
    opts[:tags] = tags
  end
  super(opts)
end