Class: AusPostAPI::Endpoint

Inherits:
Object
  • Object
show all
Includes:
Attributes
Defined in:
lib/aus_post_api/endpoint.rb,
lib/aus_post_api/endpoint/attributes.rb

Direct Known Subclasses

DCE::Endpoint, PAC::Endpoint

Defined Under Namespace

Modules: Attributes, ClassMethods, InstanceMethods Classes: ImplementationError, RequiredArgumentError

Instance Method Summary collapse

Methods included from Attributes

included

Constructor Details

#initialize(attributes, config, uri_handler = AusPostAPI::UriHandler) ⇒ Endpoint

Returns a new instance of Endpoint.



18
19
20
21
22
23
24
# File 'lib/aus_post_api/endpoint.rb', line 18

def initialize(attributes, config, uri_handler = AusPostAPI::UriHandler)
  @config      = config
  @attributes  = attributes
  @uri_handler = uri_handler

  set_attributes
end

Instance Method Details

#executeObject



26
27
28
# File 'lib/aus_post_api/endpoint.rb', line 26

def execute
  @uri_handler.call(uri, headers)
end