Class: Statement::Stment
- Inherits:
-
Object
- Object
- Statement::Stment
- Defined in:
- lib/puppet/parser/functions/statement.rb
Overview
source s_name { .. };
Instance Method Summary collapse
- #add_option(option) ⇒ Object
- #build ⇒ Object
-
#initialize(type, id, options = []) ⇒ Stment
constructor
A new instance of Stment.
Constructor Details
#initialize(type, id, options = []) ⇒ Stment
Returns a new instance of Stment.
5 6 7 8 9 |
# File 'lib/puppet/parser/functions/statement.rb', line 5 def initialize(type, id, =[]) @type = type @id = id @options = end |
Instance Method Details
#add_option(option) ⇒ Object
11 12 13 |
# File 'lib/puppet/parser/functions/statement.rb', line 11 def add_option(option) @options << option end |
#build ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/puppet/parser/functions/statement.rb', line 15 def build header = Statement.getln("#{@type} #{@id} {") Statement.increase_indent = @options.map {|item| item.build} Statement.decrease_indent tail = Statement.getln("};") return header + .join('') + tail end |