Class: AusPostAPI::DCE::Endpoint
- Defined in:
- lib/aus_post_api/dce/endpoint.rb
Overview
Abstract class that defines a DCE::Endpoint. It implements the ‘uri` & `headers` methods and expects the `api_uri` method to be implemented.
Direct Known Subclasses
Defined Under Namespace
Classes: ImplementationError, InvalidFormatError, NoFormatProvidedError, NoHeaderProvidedError
Constant Summary collapse
- LIVE_URI =
'https://api.auspost.com.au/'
- FORMATS =
['json', 'xml']
Instance Method Summary collapse
Methods inherited from Endpoint
Methods included from Endpoint::Attributes
Constructor Details
This class inherits a constructor from AusPostAPI::Endpoint
Instance Method Details
#headers ⇒ Object
15 16 17 |
# File 'lib/aus_post_api/dce/endpoint.rb', line 15 def headers { "Authorization" => "Basic #{basic_auth}" } end |
#uri ⇒ Object
11 12 13 |
# File 'lib/aus_post_api/dce/endpoint.rb', line 11 def uri "#{LIVE_URI}/#{api_uri}.#{format}?#{params}" end |