Class: ODFReport::Text

Inherits:
Field
  • Object
show all
Defined in:
lib/odf-report/text.rb

Constant Summary

Constants inherited from Field

Field::DELIMITERS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Field

#initialize, #set_source

Constructor Details

This class inherits a constructor from ODFReport::Field

Instance Attribute Details

#parserObject

Returns the value of attribute parser.



5
6
7
# File 'lib/odf-report/text.rb', line 5

def parser
  @parser
end

Instance Method Details

#replace!(doc, data_item = nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/odf-report/text.rb', line 7

def replace!(doc, data_item = nil)

  return unless node = find_text_node(doc)

  @parser = Parser::Default.new(@data_source.value, node)

  @parser.paragraphs.each do |p|
    node.before(p)
  end

  node.remove

end