Class: Deplate::Define::Region

Inherits:
Region show all
Includes:
TemplateExpander
Defined in:
lib/deplate/define.rb

Overview

class Deplate::Define::Region < Deplate::Region::SecondOrder

Instance Method Summary collapse

Methods included from TemplateExpander

#use_template

Methods inherited from Region

check_file, clean_strings, #deprecated_regnote, deprecated_regnote, #finish_accum, #format_compound, regions, register_as, set_line_cont, #setup

Methods inherited from Element

#join_lines, #join_lines_re_zh_cn

Instance Method Details

#finishObject



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/deplate/define.rb', line 120

def finish
    finish_accum
    setup_template
    @args['@body'] = @accum.join("\n")
    deprecated_regnote
    Deplate::Define.check_arguments(@mandatory, @args, @source)
    @expected = Deplate::Element
    @elt      = []
    tpl = use_template
    Deplate::Define.let_variables(@deplate, @args) do
        # p "DBG DefineRegion: #{@deplate.options.counters.inspect}"
        @elt = @deplate.parsed_array_from_strings(tpl, @source.begin, @source.file)
    end
    unless @elt.empty?
        @elt.first.put_label(@label)
    end
    return @elt
end