class Opsmgr::Settings::Microbosh::Job
Attributes
job_hash[R]
Public Class Methods
new(job_hash)
click to toggle source
# File lib/opsmgr/settings/microbosh/job.rb, line 7 def initialize(job_hash) @job_hash = job_hash end
Public Instance Methods
elb_name=(name)
click to toggle source
# File lib/opsmgr/settings/microbosh/job.rb, line 29 def elb_name=(name) job_hash['elb_name'] = name end
instances=(instance_count)
click to toggle source
# File lib/opsmgr/settings/microbosh/job.rb, line 33 def instances=(instance_count) job_hash['instances'].first['value'] = instance_count job_hash.delete('partitions') end
name()
click to toggle source
# File lib/opsmgr/settings/microbosh/job.rb, line 11 def name job_hash.fetch('identifier') rescue job_hash.fetch('type') end
networks=(networks)
click to toggle source
# File lib/opsmgr/settings/microbosh/job.rb, line 25 def networks=(networks) job_hash['network_references'] = networks end
property(property_name)
click to toggle source
# File lib/opsmgr/settings/microbosh/job.rb, line 17 def property(property_name) properties('properties').find { |property| property.name == property_name } end
resource(resource_name)
click to toggle source
# File lib/opsmgr/settings/microbosh/job.rb, line 21 def resource(resource_name) properties('resources').find { |resource| resource.name == resource_name } end
Private Instance Methods
properties(key)
click to toggle source
# File lib/opsmgr/settings/microbosh/job.rb, line 42 def properties(key) job_hash[key].map { |property| Opsmgr::Settings::Microbosh::Property.new(property) } end