Method: Db2Query::Result#to_h
- Defined in:
- lib/db2_query/result.rb
#to_h ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/db2_query/result.rb', line 25 def to_h rows.map do |row| index, hash = [0, {}] while index < columns.length attr_name = columns[index].to_sym hash[attr_name] = data_type(attr_name).deserialize(row[index]) index += 1 end hash end end |