Class: OpsmanagerClient::Client::Internals::Product

Inherits:
Object
  • Object
show all
Defined in:
lib/opsmanager_client/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Product

Returns a new instance of Product.



47
48
49
50
51
52
53
54
# File 'lib/opsmanager_client/client.rb', line 47

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

#guidObject (readonly)

Returns the value of attribute guid.



56
57
58
# File 'lib/opsmanager_client/client.rb', line 56

def guid
  @guid
end

#ipsObject (readonly)

Returns the value of attribute ips.



56
57
58
# File 'lib/opsmanager_client/client.rb', line 56

def ips
  @ips
end

#jobsObject (readonly)

Returns the value of attribute jobs.



56
57
58
# File 'lib/opsmanager_client/client.rb', line 56

def jobs
  @jobs
end

#preparedObject (readonly)

Returns the value of attribute prepared.



56
57
58
# File 'lib/opsmanager_client/client.rb', line 56

def prepared
  @prepared
end

#typeObject (readonly)

Returns the value of attribute type.



56
57
58
# File 'lib/opsmanager_client/client.rb', line 56

def type
  @type
end

#versionObject (readonly)

Returns the value of attribute version.



56
57
58
# File 'lib/opsmanager_client/client.rb', line 56

def version
  @version
end

Instance Method Details

#has_job_of_type?(job_type) ⇒ Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/opsmanager_client/client.rb', line 62

def has_job_of_type?(job_type)
  job_of_type(job_type) != nil
end

#job_of_type(job_type) ⇒ Object



58
59
60
# File 'lib/opsmanager_client/client.rb', line 58

def job_of_type(job_type)
  jobs.find { |job| job.type == job_type }
end