Class: Bosh::Template::Test::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/template/test/link.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, instances: [], properties: {}, address: nil) ⇒ Link

Returns a new instance of Link.



5
6
7
8
9
10
# File 'lib/bosh/template/test/link.rb', line 5

def initialize(name:, instances: [], properties: {}, address: nil)
  @instances = instances
  @name = name
  @properties = properties
  @address = address
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



3
4
5
# File 'lib/bosh/template/test/link.rb', line 3

def address
  @address
end

#instancesObject (readonly)

Returns the value of attribute instances.



3
4
5
# File 'lib/bosh/template/test/link.rb', line 3

def instances
  @instances
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/bosh/template/test/link.rb', line 3

def name
  @name
end

#propertiesObject (readonly)

Returns the value of attribute properties.



3
4
5
# File 'lib/bosh/template/test/link.rb', line 3

def properties
  @properties
end

Instance Method Details

#to_hObject



12
13
14
15
16
17
18
19
# File 'lib/bosh/template/test/link.rb', line 12

def to_h
  {
    'instances' => instances.map(&:to_h),
    'name' => name,
    'properties' => properties,
    'address' => address,
  }
end