Class: ActiveRecord::ConnectionAdapters::AuroraServerless::Mysql2::Result
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::AuroraServerless::Mysql2::Result
- Includes:
- Enumerable
- Defined in:
- lib/active_record/connection_adapters/aurora_serverless/mysql2/result.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #each(**kwargs) ⇒ Object
- #fields ⇒ Object
-
#initialize(response) ⇒ Result
constructor
A new instance of Result.
- #to_a ⇒ Object
Constructor Details
#initialize(response) ⇒ Result
13 14 15 |
# File 'lib/active_record/connection_adapters/aurora_serverless/mysql2/result.rb', line 13 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
11 12 13 |
# File 'lib/active_record/connection_adapters/aurora_serverless/mysql2/result.rb', line 11 def response @response end |
Instance Method Details
#each(**kwargs) ⇒ Object
28 29 30 31 |
# File 'lib/active_record/connection_adapters/aurora_serverless/mysql2/result.rb', line 28 def each(**kwargs) eobj = each_object(kwargs) block_given? ? eobj.each { |r| yield(r) } : eobj end |
#fields ⇒ Object
17 18 19 20 21 22 |
# File 'lib/active_record/connection_adapters/aurora_serverless/mysql2/result.rb', line 17 def fields @fields ||= begin md = @response. md ? md.map(&:label) : [] end end |
#to_a ⇒ Object
24 25 26 |
# File 'lib/active_record/connection_adapters/aurora_serverless/mysql2/result.rb', line 24 def to_a as_array end |