Class: Coradoc::Element::Comment::Block

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/element/comment_block.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 = {}) ⇒ Block

Returns a new instance of Block.



7
8
9
10
# File 'lib/coradoc/element/comment_block.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_block.rb', line 5

def text
  @text
end

Instance Method Details

#to_adocObject



12
13
14
15
16
17
18
# File 'lib/coradoc/element/comment_block.rb', line 12

def to_adoc
  <<~ADOC.chomp
    ////
    #{@text}
    ////#{@line_break}
  ADOC
end