Class: Imparcial::Driver::AbstractResult
- Inherits:
-
Object
- Object
- Imparcial::Driver::AbstractResult
- Defined in:
- lib/imparcial/driver/abstract/result.rb
Overview
This class will serve as base for adapter specific result class.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#specific ⇒ Object
readonly
Returns the value of attribute specific.
Instance Method Summary collapse
-
#fetch ⇒ Object
Description fetch the result.
-
#fetch_first_row ⇒ Object
Description Fetch the first row.
- #fetch_in_array ⇒ Object
-
#initialize(result_specific) ⇒ AbstractResult
constructor
A new instance of AbstractResult.
-
#rows ⇒ Object
Description get number of rows avaliable.
Constructor Details
#initialize(result_specific) ⇒ AbstractResult
Returns a new instance of AbstractResult.
9 10 11 12 13 |
# File 'lib/imparcial/driver/abstract/result.rb', line 9 def initialize ( result_specific ) @specific = result_specific end |
Instance Attribute Details
#specific ⇒ Object (readonly)
Returns the value of attribute specific.
7 8 9 |
# File 'lib/imparcial/driver/abstract/result.rb', line 7 def specific @specific end |
Instance Method Details
#fetch ⇒ Object
Description
fetch the result.
27 28 29 30 31 |
# File 'lib/imparcial/driver/abstract/result.rb', line 27 def fetch raise FeatureNotFound end |
#fetch_first_row ⇒ Object
Description
Fetch the first row. Ignoring others if avaliable.
50 51 52 53 54 55 56 |
# File 'lib/imparcial/driver/abstract/result.rb', line 50 def fetch_first_row fetch do |*rows| return *rows end end |
#fetch_in_array ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/imparcial/driver/abstract/result.rb', line 33 def fetch_in_array array = [] fetch do |*rows| array << rows end array end |
#rows ⇒ Object
Description
get number of rows avaliable.
18 19 20 21 22 |
# File 'lib/imparcial/driver/abstract/result.rb', line 18 def rows raise FeatureNotFound end |