Class: EAAL::Rowset::RowsetBase

Inherits:
Array
  • Object
show all
Defined in:
lib/eaal/rowset.rb

Overview

RowsetBase class, all RowSets should be derived from this

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.



12
13
14
# File 'lib/eaal/rowset.rb', line 12

def columns
  @columns
end

#nameObject

Returns the value of attribute name.



12
13
14
# File 'lib/eaal/rowset.rb', line 12

def name
  @name
end

#rowclassObject

Returns the value of attribute rowclass.



12
13
14
# File 'lib/eaal/rowset.rb', line 12

def rowclass
  @rowclass
end

Instance Method Details

#create_row(xml) ⇒ Object

create a new row in this RowSet



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/eaal/rowset.rb', line 15

def create_row(xml)
    row = self.rowclass.new
    self.columns.each { |colname|
        row.send(colname +"=", xml[colname]) # row content ignored so far (needs to be added!!!)
    }
    if xml.children && xml.containers.length > 0
        xml.containers.each { |child|
            el = EAAL::Result::ResultElement.parse_element(self.rowclass.name, child)
            row.add_element(el.name, el)
        }
    end
   row
end