Class: AllegroGraph::ExtendedTransport
- Defined in:
- lib/allegro_graph/extended_transport.rb
Overview
Extended transport layer for http transfers. Basic authorization and JSON transfers are supported.
Defined Under Namespace
Classes: UnexpectedStatusCodeError
Instance Attribute Summary collapse
-
#auth_type ⇒ Object
readonly
Returns the value of attribute auth_type.
-
#expected_status_code ⇒ Object
readonly
Returns the value of attribute expected_status_code.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Attributes inherited from Transport
#body, #headers, #http_method, #options, #parameters, #response, #url
Instance Method Summary collapse
-
#initialize(http_method, url, options = { }) ⇒ ExtendedTransport
constructor
A new instance of ExtendedTransport.
- #perform ⇒ Object
Constructor Details
#initialize(http_method, url, options = { }) ⇒ ExtendedTransport
Returns a new instance of ExtendedTransport.
30 31 32 33 34 35 36 |
# File 'lib/allegro_graph/extended_transport.rb', line 30 def initialize(http_method, url, = { }) super http_method, url, @expected_status_code = [:expected_status_code] @auth_type = [:auth_type] @username = [:username] @password = [:password] end |
Instance Attribute Details
#auth_type ⇒ Object (readonly)
Returns the value of attribute auth_type.
26 27 28 |
# File 'lib/allegro_graph/extended_transport.rb', line 26 def auth_type @auth_type end |
#expected_status_code ⇒ Object (readonly)
Returns the value of attribute expected_status_code.
25 26 27 |
# File 'lib/allegro_graph/extended_transport.rb', line 25 def expected_status_code @expected_status_code end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
28 29 30 |
# File 'lib/allegro_graph/extended_transport.rb', line 28 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
27 28 29 |
# File 'lib/allegro_graph/extended_transport.rb', line 27 def username @username end |
Instance Method Details
#perform ⇒ Object
38 39 40 41 42 43 |
# File 'lib/allegro_graph/extended_transport.rb', line 38 def perform initialize_headers super check_status_code parse_response end |