Class: Arrow::Template::CommentNode

Inherits:
TextNode show all
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 collapse

SVNRev =

SVN Revision

%q$Rev$
SVNId =

SVN Id

%q$Id$

Constants included from HTMLUtilities

HTMLUtilities::ARRAY_HTML_CONTAINER, HTMLUtilities::HASH_HTML_CONTAINER, HTMLUtilities::HASH_PAIR_HTML, HTMLUtilities::IMMEDIATE_OBJECT_HTML_CONTAINER, HTMLUtilities::IVAR_HTML_FRAGMENT, HTMLUtilities::OBJECT_HTML_CONTAINER, HTMLUtilities::THREAD_DUMP_KEY

Instance Attribute Summary

Attributes inherited from TextNode

#body

Attributes inherited from Node

#type

Instance Method Summary collapse

Methods inherited from TextNode

#=~, #inspect, #is_rendering_node?, #to_s

Methods inherited from Node

#add_to_template, #inspect, #is_rendering_node?, #to_a, #to_s

Methods included from HTMLUtilities

escape_html, make_html_for_object, make_object_html_wrapper

Methods inherited from Object

deprecate_class_method, deprecate_method, inherited

Constructor Details

#initialize(body, type = 'comment') ⇒ CommentNode

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

#render(template, scope) ⇒ Object

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

#to_htmlObject

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