Class: Immudb::SqlResult
- Inherits:
-
Object
- Object
- Immudb::SqlResult
- Defined in:
- lib/immudb/sql_result.rb
Instance Attribute Summary collapse
-
#column_types ⇒ Object
readonly
Returns the value of attribute column_types.
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
Instance Method Summary collapse
-
#initialize(columns, rows, column_types) ⇒ SqlResult
constructor
A new instance of SqlResult.
- #to_a ⇒ Object
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_types ⇒ Object (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 |
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
3 4 5 |
# File 'lib/immudb/sql_result.rb', line 3 def columns @columns end |
#rows ⇒ Object (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_a ⇒ Object
11 12 13 |
# File 'lib/immudb/sql_result.rb', line 11 def to_a @rows.map { |r| @columns.zip(r).to_h } end |