Class: OpsmanagerClient::Client::Internals::Job
- Inherits:
-
Object
- Object
- OpsmanagerClient::Client::Internals::Job
- Defined in:
- lib/opsmanager_client/client.rb
Instance Attribute Summary collapse
-
#guid ⇒ Object
readonly
Returns the value of attribute guid.
-
#partitions ⇒ Object
readonly
Returns the value of attribute partitions.
-
#product ⇒ Object
readonly
Returns the value of attribute product.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Job
constructor
A new instance of Job.
- #ips ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Job
Returns a new instance of Job.
20 21 22 23 24 25 26 |
# File 'lib/opsmanager_client/client.rb', line 20 def initialize(opts={}) @type = opts.fetch('identifier') @guid = opts.fetch('guid') @properties = Hash[opts.fetch('properties', {}).map{|property| [property.fetch('identifier'), property.fetch('value',nil)] }] @product = opts.fetch('product') @partitions = opts.fetch('partitions', []).map{|p| JobPartition.new(p) } end |
Instance Attribute Details
#guid ⇒ Object (readonly)
Returns the value of attribute guid.
28 29 30 |
# File 'lib/opsmanager_client/client.rb', line 28 def guid @guid end |
#partitions ⇒ Object (readonly)
Returns the value of attribute partitions.
28 29 30 |
# File 'lib/opsmanager_client/client.rb', line 28 def partitions @partitions end |
#product ⇒ Object (readonly)
Returns the value of attribute product.
28 29 30 |
# File 'lib/opsmanager_client/client.rb', line 28 def product @product end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
28 29 30 |
# File 'lib/opsmanager_client/client.rb', line 28 def properties @properties end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
28 29 30 |
# File 'lib/opsmanager_client/client.rb', line 28 def type @type end |
Instance Method Details
#ips ⇒ Object
30 31 32 |
# File 'lib/opsmanager_client/client.rb', line 30 def ips product.ips.values_at(*partitions.map(&:guid)).flatten.compact.uniq end |