Class: Arrow::Template::CommentNode
- Inherits:
-
TextNode
- Object
- Arrow::Object
- Node
- TextNode
- Arrow::Template::CommentNode
- Defined in:
- lib/arrow/template/nodes.rb
Overview
A comment node object class. Instances of this class are nodes in a syntax tree which represent the invisible markup useful for diagnosis or debugging.
Constant Summary
- SVNRev =
SVN Revision
%q$Rev$
- SVNId =
SVN Id
%q$Id$
Constants inherited from TextNode
Constants inherited from Node
Constants included from Arrow::HTMLUtilities
ARRAY_HTML_CONTAINER, HASH_HTML_CONTAINER, HASH_PAIR_HTML, IMMEDIATE_OBJECT_HTML_CONTAINER, IVAR_HTML_FRAGMENT, OBJECT_HTML_CONTAINER, THREAD_DUMP_KEY
Instance Method Summary
-
- (CommentNode) initialize(body, type = 'comment')
constructor
Create a new Arrow::Template::TextNode object with the given body.
-
- (Object) render(template, scope)
Render the comment in the context of the specified template and scope.
-
- (Object) to_html
Return an HTML fragment that can be used to represent the node symbolically in a web-based introspection interface.
Methods inherited from TextNode
#=~, #inspect, #is_rendering_node?, #to_s
Methods inherited from Node
#add_to_template, #css_class, #inspect, #is_rendering_node?, #to_a, #to_s
Methods included from Arrow::HTMLUtilities
#escape_html, #make_html_for_object, #make_object_html_wrapper
Methods inherited from Arrow::Object
deprecate_class_method, deprecate_method, inherited
Methods included from Arrow::Loggable
Constructor Details
- (CommentNode) initialize(body, type = 'comment')
Create a new Arrow::Template::TextNode object with the given body.
220 221 222 |
# File 'lib/arrow/template/nodes.rb', line 220 def initialize( body, type='comment' ) super end |
Instance Method Details
- (Object) render(template, scope)
Render the comment in the context of the specified template and scope.
230 231 232 |
# File 'lib/arrow/template/nodes.rb', line 230 def render( template, scope ) [ template.render_comment( self.to_s ) ] end |
- (Object) to_html
Return an HTML fragment that can be used to represent the node symbolically in a web-based introspection interface.
237 238 239 |
# File 'lib/arrow/template/nodes.rb', line 237 def to_html super { self.escape_html(self.to_s) } end |