Class: GenesisRuby::Network::Adapter::BaseAdapter
- Inherits:
-
Object
- Object
- GenesisRuby::Network::Adapter::BaseAdapter
- Defined in:
- lib/genesis_ruby/network/adapter/base_adapter.rb
Overview
Base Network Adapter Class
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response_body ⇒ Object
Response body is plain string received from the server Response header is hash with the received headers from the server.
-
#response_headers ⇒ Object
Response body is plain string received from the server Response header is hash with the received headers from the server.
Instance Method Summary collapse
-
#error? ⇒ Boolean
Whether the response is an error (HTTP Code != 200).
-
#execute ⇒ Object
Execute the request Return the adapter library response object.
-
#prepare_request(data) ⇒ Object
Prepare the Request Return the adapter library request object.
-
#server_message ⇒ Object
Response server message.
-
#status ⇒ Object
Retrieve HTTP Response Status Code.
Instance Attribute Details
#response_body ⇒ Object
Response body is plain string received from the server Response header is hash with the received headers from the server
11 12 13 |
# File 'lib/genesis_ruby/network/adapter/base_adapter.rb', line 11 def response_body @response_body end |
#response_headers ⇒ Object
Response body is plain string received from the server Response header is hash with the received headers from the server
11 12 13 |
# File 'lib/genesis_ruby/network/adapter/base_adapter.rb', line 11 def response_headers @response_headers end |
Instance Method Details
#error? ⇒ Boolean
Whether the response is an error (HTTP Code != 200)
31 32 33 |
# File 'lib/genesis_ruby/network/adapter/base_adapter.rb', line 31 def error? raise NotImplementedError, 'Error? method must be implemented' end |
#execute ⇒ Object
Execute the request Return the adapter library response object
26 27 28 |
# File 'lib/genesis_ruby/network/adapter/base_adapter.rb', line 26 def execute raise NotImplementedError, 'Execute method must be implemented' end |
#prepare_request(data) ⇒ Object
Prepare the Request Return the adapter library request object
20 21 22 |
# File 'lib/genesis_ruby/network/adapter/base_adapter.rb', line 20 def prepare_request(data) raise NotImplementedError, 'Prepare Request Body method must be implemented' end |
#server_message ⇒ Object
Response server message
36 37 38 |
# File 'lib/genesis_ruby/network/adapter/base_adapter.rb', line 36 def raise NotImplementedError, 'Server Message method must be implemented' end |
#status ⇒ Object
Retrieve HTTP Response Status Code
14 15 16 |
# File 'lib/genesis_ruby/network/adapter/base_adapter.rb', line 14 def status raise NotImplementedError, 'Status method must be implemented' end |