Class: ReVIEW::ComplexInlineElementNode
- Defined in:
- lib/review/node.rb,
lib/review/compiler.rb
Instance Attribute Summary collapse
-
#compiler ⇒ Object
readonly
Returns the value of attribute compiler.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Instance Method Summary collapse
-
#initialize(compiler, position, symbol, content) ⇒ ComplexInlineElementNode
constructor
A new instance of ComplexInlineElementNode.
- #to_doc ⇒ Object
- #to_json ⇒ Object
- #to_raw ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(compiler, position, symbol, content) ⇒ ComplexInlineElementNode
Returns a new instance of ComplexInlineElementNode.
943 944 945 946 947 948 |
# File 'lib/review/compiler.rb', line 943 def initialize(compiler, position, symbol, content) @compiler = compiler @position = position @symbol = symbol @content = content end |
Instance Attribute Details
#compiler ⇒ Object (readonly)
Returns the value of attribute compiler.
949 950 951 |
# File 'lib/review/compiler.rb', line 949 def compiler @compiler end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
952 953 954 |
# File 'lib/review/compiler.rb', line 952 def content @content end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
950 951 952 |
# File 'lib/review/compiler.rb', line 950 def position @position end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
951 952 953 |
# File 'lib/review/compiler.rb', line 951 def symbol @symbol end |
Instance Method Details
#to_doc ⇒ Object
155 156 157 158 |
# File 'lib/review/node.rb', line 155 def to_doc #content_str = super @compiler.compile_inline(@symbol, @content) end |
#to_json ⇒ Object
160 161 162 163 164 165 |
# File 'lib/review/node.rb', line 160 def to_json '{"ruleName":"' + self.class.to_s.sub(/ReVIEW::/,"").sub(/Node$/,"") + '",' + %Q|"symbol":"#{@symbol}",| + "\"offset\":#{position.pos},\"line\":#{position.line},\"column\":#{position.col}," + '"childNodes":[' + @content.map(&:to_json).join(",") + ']}' end |
#to_raw ⇒ Object
150 151 152 153 |
# File 'lib/review/node.rb', line 150 def to_raw content_str = super "@<#{@symbol}>{#{content_str}}" end |