Class: Birt::Core::BaseReport

Inherits:
Object
  • Object
show all
Defined in:
lib/birt/core/base_report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml_element) {|_self| ... } ⇒ BaseReport

Returns a new instance of BaseReport.

Yields:

  • (_self)

Yield Parameters:



4
5
6
7
8
9
10
# File 'lib/birt/core/base_report.rb', line 4

def initialize(xml_element)
  if xml_element
    self.id = xml_element.attribute(:id).value if xml_element.attribute(:id)
  end

  yield(self) if block_given?
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



2
3
4
# File 'lib/birt/core/base_report.rb', line 2

def id
  @id
end

Instance Method Details

#elem_text(xml_element, xpath) ⇒ Object



12
13
14
15
# File 'lib/birt/core/base_report.rb', line 12

def elem_text(xml_element, xpath)
  elements = xml_element.get_elements(xpath)
  elements&&elements[0] ? elements[0].text : nil
end