Class: Bosh::Director::DeploymentPlan::TemplateLink

Inherits:
Struct
  • Object
show all
Defined in:
lib/bosh/director/deployment_plan/links/template_link.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



3
4
5
# File 'lib/bosh/director/deployment_plan/links/template_link.rb', line 3

def name
  @name
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



3
4
5
# File 'lib/bosh/director/deployment_plan/links/template_link.rb', line 3

def type
  @type
end

Class Method Details

.parse(link_def) ⇒ Object

Raises:



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/bosh/director/deployment_plan/links/template_link.rb', line 4

def self.parse(link_def)
  if link_def.is_a?(String)
    return new(link_def, link_def)
  end

  if link_def.is_a?(Hash) && link_def.has_key?('name') && link_def.has_key?('type')
    return new(link_def['name'], link_def['type'])
  end

  raise JobInvalidLinkSpec, "Link '#{link_def}' must be either string or hash with name and type"
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/bosh/director/deployment_plan/links/template_link.rb', line 16

def to_s
  "name: #{name}, type: #{type}"
end