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.



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

#guidObject (readonly)

Returns the value of attribute guid.



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

def guid
  @guid
end

#ipsObject (readonly)

Returns the value of attribute ips.



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

def ips
  @ips
end

#jobsObject (readonly)

Returns the value of attribute jobs.



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

def jobs
  @jobs
end

#preparedObject (readonly)

Returns the value of attribute prepared.



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

def prepared
  @prepared
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

#versionObject (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

Returns:

  • (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