Class: Statement::TypedParameter
- Defined in:
- lib/puppet/parser/functions/statement.rb
Overview
like flags in a source
Instance Method Summary collapse
- #add_value(value) ⇒ Object
- #build ⇒ Object
-
#initialize(type = '') ⇒ TypedParameter
constructor
A new instance of TypedParameter.
- #type=(type) ⇒ Object
Constructor Details
#initialize(type = '') ⇒ TypedParameter
Returns a new instance of TypedParameter.
54 55 56 57 |
# File 'lib/puppet/parser/functions/statement.rb', line 54 def initialize(type='') @type = type @values = [] end |
Instance Method Details
#add_value(value) ⇒ Object
63 64 65 |
# File 'lib/puppet/parser/functions/statement.rb', line 63 def add_value(value) @values << value end |
#build ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/puppet/parser/functions/statement.rb', line 67 def build header = Statement.getln("#{@type}(") Statement.increase_indent built_values = @values.map {|item| item.build} Statement.decrease_indent tail = Statement.line(")") if @values.length >= 1 return header + built_values.join(",\n") + "\n" + tail else return header + tail end end |
#type=(type) ⇒ Object
59 60 61 |
# File 'lib/puppet/parser/functions/statement.rb', line 59 def type=(type) @type = type end |