Class: ReVIEW::ParagraphNode

Inherits:
Node show all
Defined in:
lib/review/node.rb,
lib/review/compiler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#inspect, #to_json, #to_raw, #to_s_by

Constructor Details

#initialize(compiler, position, content) ⇒ ParagraphNode

Returns a new instance of ParagraphNode.



1067
1068
1069
1070
1071
# File 'lib/review/compiler.rb', line 1067

def initialize(compiler, position, content)
  @compiler = compiler
  @position = position
  @content = content
end

Instance Attribute Details

#compilerObject (readonly)

Returns the value of attribute compiler.



1072
1073
1074
# File 'lib/review/compiler.rb', line 1072

def compiler
  @compiler
end

#contentObject (readonly)

Returns the value of attribute content.



1074
1075
1076
# File 'lib/review/compiler.rb', line 1074

def content
  @content
end

#positionObject (readonly)

Returns the value of attribute position.



1073
1074
1075
# File 'lib/review/compiler.rb', line 1073

def position
  @position
end

Instance Method Details

#to_docObject



70
71
72
73
74
# File 'lib/review/node.rb', line 70

def to_doc
  #content = @content.map(&:to_doc)
  content = super.split(/\n/)
  @compiler.compile_paragraph(content)
end