Class: Bosh::Template::EvaluationLinkInstance
- Inherits:
-
Object
- Object
- Bosh::Template::EvaluationLinkInstance
- Includes:
- PropertyHelper
- Defined in:
- lib/bosh/template/evaluation_link_instance.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#az ⇒ Object
readonly
Returns the value of attribute az.
-
#bootstrap ⇒ Object
readonly
Returns the value of attribute bootstrap.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Instance Method Summary collapse
- #if_p(*names) {|values| ... } ⇒ Object
-
#initialize(name, index, id, az, address, properties, bootstrap) ⇒ EvaluationLinkInstance
constructor
A new instance of EvaluationLinkInstance.
- #p(*args) ⇒ Object
Methods included from PropertyHelper
#copy_property, #lookup_property, #set_property, #sort_property, #validate_properties_format
Constructor Details
#initialize(name, index, id, az, address, properties, bootstrap) ⇒ EvaluationLinkInstance
Returns a new instance of EvaluationLinkInstance.
16 17 18 19 20 21 22 23 24 |
# File 'lib/bosh/template/evaluation_link_instance.rb', line 16 def initialize(name, index, id, az, address, properties, bootstrap) @name = name @index = index @id = id @az = az @address = address @properties = properties @bootstrap = bootstrap end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
12 13 14 |
# File 'lib/bosh/template/evaluation_link_instance.rb', line 12 def address @address end |
#az ⇒ Object (readonly)
Returns the value of attribute az.
11 12 13 |
# File 'lib/bosh/template/evaluation_link_instance.rb', line 11 def az @az end |
#bootstrap ⇒ Object (readonly)
Returns the value of attribute bootstrap.
14 15 16 |
# File 'lib/bosh/template/evaluation_link_instance.rb', line 14 def bootstrap @bootstrap end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/bosh/template/evaluation_link_instance.rb', line 10 def id @id end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
9 10 11 |
# File 'lib/bosh/template/evaluation_link_instance.rb', line 9 def index @index end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/bosh/template/evaluation_link_instance.rb', line 8 def name @name end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
13 14 15 |
# File 'lib/bosh/template/evaluation_link_instance.rb', line 13 def properties @properties end |
Instance Method Details
#if_p(*names) {|values| ... } ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/bosh/template/evaluation_link_instance.rb', line 39 def if_p(*names) values = names.map do |name| value = lookup_property(@properties, name) return Bosh::Template::EvaluationContext::ActiveElseBlock.new(self) if value.nil? value end yield(*values) Bosh::Template::EvaluationContext::InactiveElseBlock.new end |
#p(*args) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/bosh/template/evaluation_link_instance.rb', line 26 def p(*args) names = Array(args[0]) names.each do |name| result = lookup_property(@properties, name) return result unless result.nil? end return args[1] if args.length == 2 raise UnknownProperty, names end |