Class: Coradoc::Element::Comment::Line

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/element/comment_line.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#children_accessors, children_accessors, declare_children, #simplify_block_content, visit, #visit

Constructor Details

#initialize(text, options = {}) ⇒ Line

Returns a new instance of Line.



7
8
9
10
# File 'lib/coradoc/element/comment_line.rb', line 7

def initialize(text, options = {})
  @text = text
  @line_break = options.fetch(:line_break, "\n")
end

Instance Attribute Details

#textObject

Returns the value of attribute text.



5
6
7
# File 'lib/coradoc/element/comment_line.rb', line 5

def text
  @text
end

Instance Method Details

#to_adocObject



12
13
14
# File 'lib/coradoc/element/comment_line.rb', line 12

def to_adoc
  "// #{@text}#{@line_break}"
end