Class: Simple::SQL::Result
- Inherits:
-
Array
- Object
- Array
- Simple::SQL::Result
- Defined in:
- lib/simple/sql/result.rb,
lib/simple/sql/result.rb
Overview
The result of SQL.all
This class implements the interface of a Result.
Direct Known Subclasses
Defined Under Namespace
Modules: AssociationLoader Classes: Records, Rows
Instance Attribute Summary collapse
-
#current_page ⇒ Object
readonly
Returns the value of attribute current_page.
-
#total_count ⇒ Object
readonly
Returns the value of attribute total_count.
-
#total_pages ⇒ Object
readonly
Returns the value of attribute total_pages.
Class Method Summary collapse
-
.build(records, target_type:, pg_source_oid:) ⇒ Object
A Result object is requested via ::Simple::SQL::Result.build, which then chooses the correct implementation, based on the
target_type:parameter.
Instance Attribute Details
#current_page ⇒ Object (readonly)
Returns the value of attribute current_page.
26 27 28 |
# File 'lib/simple/sql/result.rb', line 26 def current_page @current_page end |
#total_count ⇒ Object (readonly)
Returns the value of attribute total_count.
24 25 26 |
# File 'lib/simple/sql/result.rb', line 24 def total_count @total_count end |
#total_pages ⇒ Object (readonly)
Returns the value of attribute total_pages.
25 26 27 |
# File 'lib/simple/sql/result.rb', line 25 def total_pages @total_pages end |
Class Method Details
.build(records, target_type:, pg_source_oid:) ⇒ Object
A Result object is requested via ::Simple::SQL::Result.build, which then chooses the correct implementation, based on the target_type: parameter.
16 17 18 19 20 21 22 |
# File 'lib/simple/sql/result.rb', line 16 def self.build(records, target_type:, pg_source_oid:) # :nodoc: if target_type.nil? Rows.new(records) else Records.new(records, target_type: target_type, pg_source_oid: pg_source_oid) end end |