Class: Coradoc::Element::TextElement

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

Direct Known Subclasses

Highlight

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content, options = {}) ⇒ TextElement

Returns a new instance of TextElement.



5
6
7
8
9
# File 'lib/coradoc/element/text_element.rb', line 5

def initialize(content, options = {})
  @content = content#.to_s
  @id = options.fetch(:id, nil)
  @line_break = options.fetch(:line_break, "")
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



3
4
5
# File 'lib/coradoc/element/text_element.rb', line 3

def content
  @content
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/coradoc/element/text_element.rb', line 3

def id
  @id
end

#line_breakObject (readonly)

Returns the value of attribute line_break.



3
4
5
# File 'lib/coradoc/element/text_element.rb', line 3

def line_break
  @line_break
end

Instance Method Details

#to_adocObject



11
12
13
# File 'lib/coradoc/element/text_element.rb', line 11

def to_adoc
  Coradoc::Generator.gen_adoc(@content)
end