Class: Bosh::Stemcell::Definition
- Inherits:
-
Object
- Object
- Bosh::Stemcell::Definition
- Defined in:
- lib/bosh/stemcell/definition.rb
Instance Attribute Summary collapse
-
#agent ⇒ Object
readonly
Returns the value of attribute agent.
-
#hypervisor_name ⇒ Object
readonly
Returns the value of attribute hypervisor_name.
-
#infrastructure ⇒ Object
readonly
Returns the value of attribute infrastructure.
-
#operating_system ⇒ Object
readonly
Returns the value of attribute operating_system.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #disk_formats ⇒ Object
-
#initialize(infrastructure, hypervisor_name, operating_system, agent, light) ⇒ Definition
constructor
A new instance of Definition.
- #light? ⇒ Boolean
- #stemcell_name(disk_format) ⇒ Object
Constructor Details
#initialize(infrastructure, hypervisor_name, operating_system, agent, light) ⇒ Definition
Returns a new instance of Definition.
26 27 28 29 30 31 32 |
# File 'lib/bosh/stemcell/definition.rb', line 26 def initialize(infrastructure, hypervisor_name, , agent, light) @infrastructure = infrastructure @hypervisor_name = hypervisor_name @operating_system = @agent = agent @light = light end |
Instance Attribute Details
#agent ⇒ Object (readonly)
Returns the value of attribute agent.
7 8 9 |
# File 'lib/bosh/stemcell/definition.rb', line 7 def agent @agent end |
#hypervisor_name ⇒ Object (readonly)
Returns the value of attribute hypervisor_name.
7 8 9 |
# File 'lib/bosh/stemcell/definition.rb', line 7 def hypervisor_name @hypervisor_name end |
#infrastructure ⇒ Object (readonly)
Returns the value of attribute infrastructure.
7 8 9 |
# File 'lib/bosh/stemcell/definition.rb', line 7 def infrastructure @infrastructure end |
#operating_system ⇒ Object (readonly)
Returns the value of attribute operating_system.
7 8 9 |
# File 'lib/bosh/stemcell/definition.rb', line 7 def @operating_system end |
Class Method Details
.for(infrastructure_name, hypervisor_name, operating_system_name, operating_system_version, agent_name, light) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/bosh/stemcell/definition.rb', line 9 def self.for( infrastructure_name, hypervisor_name, , , agent_name, light ) new( Bosh::Stemcell::Infrastructure.for(infrastructure_name), hypervisor_name, Bosh::Stemcell::OperatingSystem.for(, ), Bosh::Stemcell::Agent.for(agent_name), light, ) end |
Instance Method Details
#==(other) ⇒ Object
51 52 53 54 55 56 |
# File 'lib/bosh/stemcell/definition.rb', line 51 def ==(other) infrastructure == other.infrastructure && == other. && agent == other.agent && light? == other.light? end |
#disk_formats ⇒ Object
47 48 49 |
# File 'lib/bosh/stemcell/definition.rb', line 47 def disk_formats infrastructure.disk_formats end |
#light? ⇒ Boolean
58 59 60 |
# File 'lib/bosh/stemcell/definition.rb', line 58 def light? @light == true end |
#stemcell_name(disk_format) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/bosh/stemcell/definition.rb', line 34 def stemcell_name(disk_format) stemcell_name_parts = [ infrastructure.name, hypervisor_name, .name, ] stemcell_name_parts << .version if .version stemcell_name_parts << "#{agent.name}_agent" unless agent.name == 'ruby' stemcell_name_parts << disk_format unless disk_format == infrastructure.default_disk_format stemcell_name_parts.join('-') end |