Class: Imparcial::Driver::MysqlResult

Inherits:
AbstractResult show all
Defined in:
lib/imparcial/driver/mysql/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
# File 'lib/imparcial/driver/mysql/result.rb', line 11

def fetch

  fields = @specific.fetch_fields
          
  @specific.each do |row|
    
    v = []
    
    row.each_with_index do |r, index|
     
      v << Row.new(fields[index].name, r)
      
    end
    
    yield(*v)
    
  end                 

end

#rowsObject



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

def rows

  @specific.num_rows

end