Class: AllegroGraph::Transport
- Inherits:
-
Object
- Object
- AllegroGraph::Transport
- Defined in:
- lib/allegro_graph/transport.rb
Overview
Common transport layer for http transfers.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(http_method, url, options = { }) ⇒ Transport
constructor
A new instance of Transport.
- #perform ⇒ Object
Constructor Details
#initialize(http_method, url, options = { }) ⇒ Transport
Returns a new instance of Transport.
18 19 20 21 22 23 24 |
# File 'lib/allegro_graph/transport.rb', line 18 def initialize(http_method, url, = { }) @http_method = http_method @uri = URI.parse url @headers = [:headers] || { } @parameters = [:parameters] || { } @body = [:body] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
15 16 17 |
# File 'lib/allegro_graph/transport.rb', line 15 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
13 14 15 |
# File 'lib/allegro_graph/transport.rb', line 13 def headers @headers end |
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
10 11 12 |
# File 'lib/allegro_graph/transport.rb', line 10 def http_method @http_method end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/allegro_graph/transport.rb', line 12 def @options end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
14 15 16 |
# File 'lib/allegro_graph/transport.rb', line 14 def parameters @parameters end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
16 17 18 |
# File 'lib/allegro_graph/transport.rb', line 16 def response @response end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
11 12 13 |
# File 'lib/allegro_graph/transport.rb', line 11 def url @url end |
Instance Method Details
#perform ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/allegro_graph/transport.rb', line 26 def perform initialize_request_class initialize_request_path initialize_request initialize_request_body perform_request end |