Class: Immudb::SqlResult

Inherits:
Object
  • Object
show all
Defined in:
lib/immudb/sql_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(columns, rows, column_types) ⇒ SqlResult

Returns a new instance of SqlResult.



5
6
7
8
9
# File 'lib/immudb/sql_result.rb', line 5

def initialize(columns, rows, column_types)
  @columns = columns
  @rows = rows
  @column_types = column_types
end

Instance Attribute Details

#column_typesObject (readonly)

Returns the value of attribute column_types.



3
4
5
# File 'lib/immudb/sql_result.rb', line 3

def column_types
  @column_types
end

#columnsObject (readonly)

Returns the value of attribute columns.



3
4
5
# File 'lib/immudb/sql_result.rb', line 3

def columns
  @columns
end

#rowsObject (readonly)

Returns the value of attribute rows.



3
4
5
# File 'lib/immudb/sql_result.rb', line 3

def rows
  @rows
end

Instance Method Details

#to_aObject



11
12
13
# File 'lib/immudb/sql_result.rb', line 11

def to_a
  @rows.map { |r| @columns.zip(r).to_h }
end