class ReVIEW::TextNode

Attributes

compiler[R]
content[R]
position[R]

Public Class Methods

new(compiler, position, content) click to toggle source
# File lib/review/compiler.rb, line 1109
def initialize(compiler, position, content)
  @compiler = compiler
  @position = position
  @content = content
end

Public Instance Methods

to_doc() click to toggle source
Calls superclass method ReVIEW::Node#to_doc
# File lib/review/node.rb, line 181
def to_doc
  content_str = super
  @compiler.compile_text(content_str)
end
to_json(*args) click to toggle source
# File lib/review/node.rb, line 186
def to_json(*args)
  val = '"'+@content.gsub(/\"/,'\\"').gsub(/\n/,'\\n')+'"'
  '{"ruleName":"' + self.class.to_s.sub(/ReVIEW::/,"").sub(/Node$/,"") + '",' +
    "\"offset\":#{position.pos},\"line\":#{position.line},\"column\":#{position.col}," +
    '"text":' + val + '}'
end
to_raw() click to toggle source
Calls superclass method ReVIEW::Node#to_raw
# File lib/review/node.rb, line 176
def to_raw
  content_str = super
  content_str.to_s
end