Class: Olap::RowSet
- Inherits:
-
Object
- Object
- Olap::RowSet
- Defined in:
- lib/olap4r/rowset.rb
Instance Method Summary collapse
-
#columns ⇒ Object
Returns list of columns.
-
#initialize(rowset) ⇒ RowSet
constructor
A new instance of RowSet.
-
#values(value_type = :formatted_value) ⇒ Object
Returns query values.
Constructor Details
#initialize(rowset) ⇒ RowSet
Returns a new instance of RowSet.
3 4 5 |
# File 'lib/olap4r/rowset.rb', line 3 def initialize rowset @rowset = rowset end |
Instance Method Details
#columns ⇒ Object
Returns list of columns
9 10 11 12 13 14 15 16 |
# File 'lib/olap4r/rowset.rb', line 9 def columns @columns ||= 1.upto(@rowset..get_column_count).map do |i| { :id => @rowset..getColumnName(i), :name => @rowset..getColumnLabel(i) } end end |
#values(value_type = :formatted_value) ⇒ Object
Returns query values
Attributes
-
value_type
- Returned value type (:value or :formatted_value)
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/olap4r/rowset.rb', line 24 def values value_type = :formatted_value return @values unless @values.nil? @values = [] while @rowset.next do @values << 1.upto(self.columns.size).map do |i| @rowset.getString i end end @values end |