Class: Fetcher::Postgres::Types::Response
- Inherits:
-
Object
- Object
- Fetcher::Postgres::Types::Response
- Defined in:
- lib/bas/fetcher/postgres/types/response.rb
Overview
Represents a response received from the Postgres API. It encapsulates essential information about the response, providing a structured way to handle and analyze it’s responses.
Constant Summary collapse
- SUCCESS_STATUS =
"PGRES_TUPLES_OK"
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#records ⇒ Object
readonly
Returns the value of attribute records.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
14 15 16 17 18 19 20 |
# File 'lib/bas/fetcher/postgres/types/response.rb', line 14 def initialize(response) if response.res_status == SUCCESS_STATUS success_response(response) else failure_response(response) end end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
10 11 12 |
# File 'lib/bas/fetcher/postgres/types/response.rb', line 10 def fields @fields end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
10 11 12 |
# File 'lib/bas/fetcher/postgres/types/response.rb', line 10 def @message end |
#records ⇒ Object (readonly)
Returns the value of attribute records.
10 11 12 |
# File 'lib/bas/fetcher/postgres/types/response.rb', line 10 def records @records end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
10 11 12 |
# File 'lib/bas/fetcher/postgres/types/response.rb', line 10 def response @response end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
10 11 12 |
# File 'lib/bas/fetcher/postgres/types/response.rb', line 10 def status @status end |