Class: OpsmanagerClient::Client::Internals::Product
- Inherits:
-
Object
- Object
- OpsmanagerClient::Client::Internals::Product
- Defined in:
- lib/opsmanager_client/client.rb
Instance Attribute Summary collapse
-
#guid ⇒ Object
readonly
Returns the value of attribute guid.
-
#ips ⇒ Object
readonly
Returns the value of attribute ips.
-
#jobs ⇒ Object
readonly
Returns the value of attribute jobs.
-
#prepared ⇒ Object
readonly
Returns the value of attribute prepared.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #has_job_of_type?(job_type) ⇒ Boolean
-
#initialize(opts = {}) ⇒ Product
constructor
A new instance of Product.
- #job_of_type(job_type) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Product
Returns a new instance of Product.
46 47 48 49 50 51 52 53 |
# File 'lib/opsmanager_client/client.rb', line 46 def initialize(opts={}) @jobs = opts.fetch('jobs').map{|job_details| Internals::Job.new(job_details.merge('product' => self)) } @ips = opts.fetch('ips', {}) @type = opts.fetch('identifier') @version = opts.fetch('product_version') @guid = opts.fetch('guid') @prepared = opts.fetch('prepared') end |
Instance Attribute Details
#guid ⇒ Object (readonly)
Returns the value of attribute guid.
55 56 57 |
# File 'lib/opsmanager_client/client.rb', line 55 def guid @guid end |
#ips ⇒ Object (readonly)
Returns the value of attribute ips.
55 56 57 |
# File 'lib/opsmanager_client/client.rb', line 55 def ips @ips end |
#jobs ⇒ Object (readonly)
Returns the value of attribute jobs.
55 56 57 |
# File 'lib/opsmanager_client/client.rb', line 55 def jobs @jobs end |
#prepared ⇒ Object (readonly)
Returns the value of attribute prepared.
55 56 57 |
# File 'lib/opsmanager_client/client.rb', line 55 def prepared @prepared end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
55 56 57 |
# File 'lib/opsmanager_client/client.rb', line 55 def type @type end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
55 56 57 |
# File 'lib/opsmanager_client/client.rb', line 55 def version @version end |
Instance Method Details
#has_job_of_type?(job_type) ⇒ Boolean
61 62 63 |
# File 'lib/opsmanager_client/client.rb', line 61 def has_job_of_type?(job_type) job_of_type(job_type) != nil end |
#job_of_type(job_type) ⇒ Object
57 58 59 |
# File 'lib/opsmanager_client/client.rb', line 57 def job_of_type(job_type) jobs.find { |job| job.type == job_type } end |