Class: Imparcial::Driver::PostgreResult

Inherits:
AbstractResult show all
Defined in:
lib/imparcial/driver/postgre/result.rb

Instance Attribute Summary

Attributes inherited from AbstractResult

#specific

Instance Method Summary collapse

Methods inherited from AbstractResult

#fetch_first_row, #fetch_in_array, #initialize

Constructor Details

This class inherits a constructor from Imparcial::Driver::AbstractResult

Instance Method Details

#fetchObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/imparcial/driver/postgre/result.rb', line 11

def fetch

  fields = @specific.fields
  rows   = @specific.result
  
  rows.each do |row|
  
    v = []
  
    row.each_with_index do |value, index|
      
      v << Row.new(fields[index], value)
      
    end
  
    yield(*v)
  
  end        
  

end

#rowsObject



5
6
7
8
9
# File 'lib/imparcial/driver/postgre/result.rb', line 5

def rows

 @specific.result.length

end