Class: Bosh::Director::DeploymentPlan::CompiledPackage

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/deployment_plan/compiled_package.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ CompiledPackage

Returns a new instance of CompiledPackage.

Parameters:



17
18
19
20
21
22
# File 'lib/bosh/director/deployment_plan/compiled_package.rb', line 17

def initialize(model)
  @model = model

  @name = model.package.name
  @version = model.package.version
end

Instance Attribute Details

#modelModels::CompiledPackage (readonly)

Returns Compiled package DB model.

Returns:



8
9
10
# File 'lib/bosh/director/deployment_plan/compiled_package.rb', line 8

def model
  @model
end

#nameString (readonly)

Returns Package name.

Returns:

  • (String)

    Package name



11
12
13
# File 'lib/bosh/director/deployment_plan/compiled_package.rb', line 11

def name
  @name
end

#versionString (readonly)

Returns Package version.

Returns:

  • (String)

    Package version



14
15
16
# File 'lib/bosh/director/deployment_plan/compiled_package.rb', line 14

def version
  @version
end

Instance Method Details

#specHash<String,Object>

Returns Hash representation.

Returns:



25
26
27
28
29
30
31
32
# File 'lib/bosh/director/deployment_plan/compiled_package.rb', line 25

def spec
  {
    "name" => @name,
    "version" => "#{@version}.#{@model.build}",
    "sha1" => @model.sha1,
    "blobstore_id" => @model.blobstore_id
  }
end