Sha256: e4398ee0e68a24bfbb23f8b6a232bbd789a0cf50d5cc6f054496d908d939126e

Contents?: true

Size: 402 Bytes

Versions: 43

Compression:

Stored size: 402 Bytes

Contents

module Specinfra
  class HostInventory
    include Singleton

    def initialize
      property[:host_inventory] ||= {}
      @inventory = property[:host_inventory]
    end

    def [](key)
      @inventory[key.to_sym] ||= {}
      if @inventory[key.to_sym].empty?
        @inventory[key.to_sym] = Specinfra::Runner.send("get_inventory_#{key}")
      end
      @inventory[key.to_sym]
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
specinfra-2.11.6 lib/specinfra/host_inventory.rb
specinfra-2.11.5 lib/specinfra/host_inventory.rb
specinfra-2.11.4 lib/specinfra/host_inventory.rb
specinfra-2.11.3 lib/specinfra/host_inventory.rb
specinfra-2.11.2 lib/specinfra/host_inventory.rb
specinfra-2.11.1 lib/specinfra/host_inventory.rb
specinfra-2.11.0 lib/specinfra/host_inventory.rb
specinfra-2.10.4 lib/specinfra/host_inventory.rb
specinfra-2.10.3 lib/specinfra/host_inventory.rb
specinfra-2.10.2 lib/specinfra/host_inventory.rb
specinfra-2.10.1 lib/specinfra/host_inventory.rb
specinfra-2.10.0 lib/specinfra/host_inventory.rb
specinfra-2.9.3 lib/specinfra/host_inventory.rb
specinfra-2.9.2 lib/specinfra/host_inventory.rb
specinfra-2.9.1 lib/specinfra/host_inventory.rb
specinfra-2.9.0 lib/specinfra/host_inventory.rb
specinfra-2.8.0 lib/specinfra/host_inventory.rb
specinfra-2.7.0 lib/specinfra/host_inventory.rb
specinfra-2.6.0 lib/specinfra/host_inventory.rb
specinfra-2.5.0 lib/specinfra/host_inventory.rb