Class: Deplate::Regions::Native

Inherits:
Deplate::Region show all
Defined in:
lib/deplate/regions.rb,
lib/deplate/define.rb

Direct Known Subclasses

Code, Php, Write

Instance Method Summary collapse

Methods inherited from Deplate::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

#expand_templateObject



360
361
362
363
364
365
366
367
368
369
370
371
372
# File 'lib/deplate/define.rb', line 360

def expand_template
    deprecated_regnote
    @args['@body'] = @accum.join("\n")
    tmpl = Deplate::Template.new(:master => @deplate,
                                 :template => @template, 
                                 :source => @source, 
                                 :container => self)
    rv = nil
    Deplate::Define.let_variables(@deplate, @args) do
        rv = tmpl.fill_in(@deplate, :body => @args['@body'], :source => @source)
    end
    return rv
end

#finishObject



210
211
212
213
214
215
216
217
# File 'lib/deplate/regions.rb', line 210

def finish
    finish_accum
    @elt = @accum
    if @args['template']
        @elt = filter_template(@elt)
    end
    return self
end

#format_specialObject



224
225
226
227
228
229
230
231
232
233
# File 'lib/deplate/regions.rb', line 224

def format_special
    case @elt
    when Array
        @elt.join("\n")
    else
        puts "TBD DBG This shouldn't be @elt.class=#{@elt.class}. Please report."
        puts @elt
        @elt
    end
end

#processObject



219
220
221
222
# File 'lib/deplate/regions.rb', line 219

def process
    process_etc
    return self
end