Included Modules

Inversion::Template::TextNode

Inversion text node class -- container for static content in templates between tags.

Attributes

body[R]

The node body

Public Class Methods

new( body, linenum=nil, colnum=nil ) click to toggle source

Create a new TextNode with the specified source.

# File lib/inversion/template/textnode.rb, line 11
def initialize( body, linenum=nil, colnum=nil )
        @body = body
        super
end

Public Instance Methods

as_comment_body() click to toggle source

Render the text node as the body of a comment.

# File lib/inversion/template/textnode.rb, line 35
def as_comment_body
        comment_body = self.body[0,40].dump
        comment_body[-1,0] = '...' unless comment_body == self.body.dump
        return "Text (%d bytes): %s" % [ self.body.length, comment_body ]
end
render( renderstate ) click to toggle source

Render the node.

# File lib/inversion/template/textnode.rb, line 26
def render( renderstate )
        body = self.body.dup
        body.sub!( /\A\r?\n/, '' ) if renderstate && renderstate.options[:strip_tag_lines]

        return body
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.