Sha256: 39352ecce760197ea0ce475e5d2d6ec68fc4833a5decea99d55ffaa93289a3de

Contents?: true

Size: 485 Bytes

Versions: 7

Compression:

Stored size: 485 Bytes

Contents

require 'itamae'
require 'hashie'
require 'json'

module Itamae
  class Node < Hashie::Mash
    def reverse_merge(other_hash)
      Hashie::Mash.new(other_hash).merge(self)
    end

    def reverse_merge!(other_hash)
      self.replace(reverse_merge(other_hash))
    end

    def [](key)
      val = super(key)
      if val.nil?
        begin
          val = host_inventory[key]
        rescue NotImplementedError
          val = nil
        end
      end
      val
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
itamae-1.1.3 lib/itamae/node.rb
itamae-1.1.2 lib/itamae/node.rb
itamae-1.1.1 lib/itamae/node.rb
itamae-1.1.0 lib/itamae/node.rb
itamae-1.0.13 lib/itamae/node.rb
itamae-1.0.12 lib/itamae/node.rb
itamae-1.0.11 lib/itamae/node.rb