Class: Packer::Message::TemplateVariable
- Defined in:
- lib/packer/message/template_variable.rb
Overview
Message representing a user variable defined within the template
Instance Attribute Summary collapse
-
#default ⇒ Object
The default value of the variable.
-
#name ⇒ Object
The name of the variable.
-
#required ⇒ Object
If non-zero, then this variable is required.
Attributes inherited from Base
#data, #target, #timestamp, #type
Class Method Summary collapse
- .from_fields(fields) ⇒ Object private
Instance Attribute Details
#default ⇒ Object
The default value of the variable
11 12 13 |
# File 'lib/packer/message/template_variable.rb', line 11 def default @default end |
#name ⇒ Object
The name of the variable
8 9 10 |
# File 'lib/packer/message/template_variable.rb', line 8 def name @name end |
#required ⇒ Object
If non-zero, then this variable is required
14 15 16 |
# File 'lib/packer/message/template_variable.rb', line 14 def required @required end |
Class Method Details
.from_fields(fields) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/packer/message/template_variable.rb', line 18 def self.from_fields(fields) msg = new msg. = fields[0] msg.target = fields[1] msg.type = fields[2] msg.data = fields[3..-1] msg.name = fields[3] msg.default = fields[4] msg.required = fields[5] msg end |