Class: Opsmgr::Api::InstalledProductsResult

Inherits:
Result
  • Object
show all
Defined in:
lib/opsmgr/api/results.rb

Instance Attribute Summary

Attributes inherited from Result

#message

Instance Method Summary collapse

Methods inherited from Result

#success?

Constructor Details

#initialize(installed_products) ⇒ InstalledProductsResult

Returns a new instance of InstalledProductsResult.



85
86
87
# File 'lib/opsmgr/api/results.rb', line 85

def initialize(installed_products)
  @installed_products = installed_products
end

Instance Method Details

#guid_for(product_type) ⇒ Object



89
90
91
92
# File 'lib/opsmgr/api/results.rb', line 89

def guid_for(product_type)
  product_result = installed_products.find { |h| h.name == product_type }
  product_result ? product_result.fetch('guid') : nil
end