Module OpenWFE::TemplateMixin
In: lib/openwfe/participants/participants.rb

This mixin provides an eval_template() method. This method assumes the target class has a @block_template and a @template, it also assumes the class includes the module LocalParticipant.

This mixin is used for example in the MailParticipant class.

Methods

Public Instance methods

Given a workitem, expands the template and returns it as a String.

[Source]

     # File lib/openwfe/participants/participants.rb, line 373
373:         def eval_template (workitem)
374: 
375:             fe = get_flow_expression workitem
376: 
377:             template = if @block_template
378: 
379:                 call_block @block_template, workitem
380: 
381:             elsif @template
382: 
383:                 template = if @template.kind_of?(File)
384:                     @template.readlines
385:                 else
386:                     @template.to_s
387:                 end
388: 
389:             else
390: 
391:                 nil
392:             end
393: 
394:             return "(no template given)" unless template
395: 
396:             OpenWFE::dosub template, fe, workitem
397:         end

[Validate]