Class: ReVIEW::ParagraphNode
- 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.
Instance Method Summary collapse
-
#initialize(compiler, position, content) ⇒ ParagraphNode
constructor
A new instance of ParagraphNode.
- #to_doc ⇒ Object
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
#compiler ⇒ Object (readonly)
Returns the value of attribute compiler.
1072 1073 1074 |
# File 'lib/review/compiler.rb', line 1072 def compiler @compiler end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
1074 1075 1076 |
# File 'lib/review/compiler.rb', line 1074 def content @content end |
#position ⇒ Object (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_doc ⇒ Object
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 |