Mixin which adds the notion of boolean evaluability to a directive.
Returns true if this Directive, in the context of the given template (an Arrow::Template) and scope (a Binding object), should be considered "true".
# File /Users/ged/source/ruby/Arrow/lib/arrow/template/nodes.rb, line 766
766: def evaluate( template, scope )
767: rval = self.call_methodchain( template, scope )
768:
769: #self.log.debug "Methodchain evaluated to %s: %p" %
770: # [ rval ? "true" : "false", rval ]
771: return rval ? true : false
772: end
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.
# File /Users/ged/source/ruby/Arrow/lib/arrow/template/nodes.rb, line 758
758: def is_rendering_node?
759: false
760: end
--- SEC00158
--- ""
---
- methods:
- visibility: public
aref: M000475
name: evaluate
sourcecode: " <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/template/nodes.rb, line 766</span>\n\
766: <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">evaluate</span>( <span class=\"ruby-identifier\">template</span>, <span class=\"ruby-identifier\">scope</span> )\n\
767: <span class=\"ruby-identifier\">rval</span> = <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">call_methodchain</span>( <span class=\"ruby-identifier\">template</span>, <span class=\"ruby-identifier\">scope</span> )\n\
768: \n\
769: <span class=\"ruby-comment cmt\">#self.log.debug "Methodchain evaluated to %s: %p" %</span>\n\
770: <span class=\"ruby-comment cmt\"># [ rval ? "true" : "false", rval ]</span>\n\
771: <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">rval</span> <span class=\"ruby-operator\">?</span> <span class=\"ruby-keyword kw\">true</span> <span class=\"ruby-operator\">:</span> <span class=\"ruby-keyword kw\">false</span>\n\
772: <span class=\"ruby-keyword kw\">end</span>"
m_desc: |-
<p>
Returns <tt>true</tt> if this <a href="Directive.html">Directive</a>, in
the context of the given <tt>template</tt> (an <a
href="../Template.html">Arrow::Template</a>) and <tt>scope</tt> (a Binding
object), should be considered "true".
</p>
params: ( template, scope )
- visibility: public
aref: M000474
name: is_rendering_node?
sourcecode: " <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/template/nodes.rb, line 758</span>\n\
758: <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">is_rendering_node?</span>\n\
759: <span class=\"ruby-keyword kw\">false</span>\n\
760: <span class=\"ruby-keyword kw\">end</span>"
m_desc: |-
<p>
Returns <tt>true</tt> 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.
</p>
params: ()
category: Instance
type: Public
---
---
- name: SVNRev
desc: |+
SVN Revision
value: "%q$Rev: 437 $"
- name: SVNId
desc: |+
SVN Id
value: "%q$Id: nodes.rb 437 2008-03-28 00:49:20Z deveiant $"
Generated with the Darkfish Rdoc Generator.