Module: Arrow::Template::ConditionalDirective
- Included in:
- ElsifDirective, IfDirective, UnlessDirective
- Defined in:
- lib/arrow/template/nodes.rb
Overview
Mixin which adds the notion of boolean evaluability to a directive.
Constant Summary
- SVNRev =
SVN Revision
%q$Rev$
- SVNId =
SVN Id
%q$Id$
Instance Method Summary
-
- (Object) evaluate(template, scope)
Returns true if this Directive, in the context of the given template (an Arrow::Template) and scope (a Binding object), should be considered “true”.
-
- (Boolean) is_rendering_node?
Returns true for nodes which generate output themselves (as opposed to ones which generate output through subnodes).
Instance Method Details
- (Object) evaluate(template, scope)
Returns true if this Directive, in the context of the given template (an Arrow::Template) and scope (a Binding object), should be considered “true”.
722 723 724 725 726 727 728 |
# File 'lib/arrow/template/nodes.rb', line 722 def evaluate( template, scope ) rval = self.call_methodchain( template, scope ) #self.log.debug "Methodchain evaluated to %s: %p" % # [ rval ? "true" : "false", rval ] return rval ? true : false end |
- (Boolean) is_rendering_node?
Returns true for nodes which generate output themselves (as opposed to ones which generate output through subnodes). This is used for eliding blank lines from the node tree.
714 715 716 |
# File 'lib/arrow/template/nodes.rb', line 714 def is_rendering_node? false end |