Class: TopologicalInventory::Providers::Common::Collector::Parser
- Inherits:
-
Object
- Object
- TopologicalInventory::Providers::Common::Collector::Parser
- Defined in:
- lib/topological_inventory/providers/common/collector/parser.rb
Instance Attribute Summary collapse
-
#collections ⇒ Object
Returns the value of attribute collections.
-
#resource_timestamp ⇒ Object
Returns the value of attribute resource_timestamp.
Instance Method Summary collapse
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
- #lazy_find(collection, reference, ref: :manager_ref) ⇒ Object
Constructor Details
#initialize ⇒ Parser
Returns a new instance of Parser.
12 13 14 15 16 |
# File 'lib/topological_inventory/providers/common/collector/parser.rb', line 12 def initialize @collections = InventoryCollectionStorage.new self. = Time.now.utc end |
Instance Attribute Details
#collections ⇒ Object
Returns the value of attribute collections.
8 9 10 |
# File 'lib/topological_inventory/providers/common/collector/parser.rb', line 8 def collections @collections end |
#resource_timestamp ⇒ Object
Returns the value of attribute resource_timestamp.
8 9 10 |
# File 'lib/topological_inventory/providers/common/collector/parser.rb', line 8 def @resource_timestamp end |
Instance Method Details
#lazy_find(collection, reference, ref: :manager_ref) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/topological_inventory/providers/common/collector/parser.rb', line 18 def lazy_find(collection, reference, ref: :manager_ref) return if reference.kind_of?(String) && reference.blank? # Don't make lazy link if all reference values are blank return if reference.kind_of?(Hash) && reference.values.select { |val| val.to_s.present? }.blank? TopologicalInventoryIngressApiClient::InventoryObjectLazy.new( :inventory_collection_name => collection, :reference => reference, :ref => ref, ) end |