Class: AusPostAPI::PAC
- Inherits:
-
Object
- Object
- AusPostAPI::PAC
- Defined in:
- lib/aus_post_api/pac.rb,
lib/aus_post_api/pac/country.rb,
lib/aus_post_api/pac/endpoint.rb,
lib/aus_post_api/pac/domestic_letter_size.rb,
lib/aus_post_api/pac/domestic_parcel_size.rb,
lib/aus_post_api/pac/domestic_parcel_type.rb,
lib/aus_post_api/pac/domestic_letter_weight.rb,
lib/aus_post_api/pac/domestic_parcel_weight.rb,
lib/aus_post_api/pac/domestic_postcode_search.rb,
lib/aus_post_api/pac/domestic_letter_thickness.rb,
lib/aus_post_api/pac/international_letter_weight.rb,
lib/aus_post_api/pac/international_parcel_weight.rb,
lib/aus_post_api/pac/postage_letter_domestic_service.rb,
lib/aus_post_api/pac/postage_parcel_domestic_service.rb,
lib/aus_post_api/pac/postage_letter_domestic_calculate.rb,
lib/aus_post_api/pac/postage_parcel_domestic_calculate.rb,
lib/aus_post_api/pac/postage_letter_international_service.rb,
lib/aus_post_api/pac/postage_parcel_international_service.rb,
lib/aus_post_api/pac/postage_letter_international_calculate.rb,
lib/aus_post_api/pac/postage_parcel_international_calculate.rb
Overview
The PAC class implements methods specified by the Australia Post Postage Assessment Calculator. A config hash must be supplied that specifies a valid PAC_AUTH_KEY, and request format. Setting the key TEST to true in the config hash will ignore any supplied auth_key and use the test endpoint.
Defined Under Namespace
Classes: Country, DomesticLetterSize, DomesticLetterThickness, DomesticLetterWeight, DomesticParcelSize, DomesticParcelType, DomesticParcelWeight, DomesticPostcodeSearch, Endpoint, InternationalLetterWeight, InternationalParcelWeight, PostageLetterDomesticCalculate, PostageLetterDomesticService, PostageLetterInternationalCalculate, PostageLetterInternationalService, PostageParcelDomesticCalculate, PostageParcelDomesticService, PostageParcelInternationalCalculate, PostageParcelInternationalService
Instance Method Summary collapse
- #country(params = {}) ⇒ Object
- #domestic_letter_size(params = {}) ⇒ Object
- #domestic_letter_thickness(params = {}) ⇒ Object
- #domestic_letter_weight(params = {}) ⇒ Object
- #domestic_parcel_size(params = {}) ⇒ Object
- #domestic_parcel_type(params = {}) ⇒ Object
- #domestic_parcel_weight(params = {}) ⇒ Object
- #domestic_postcode_search(params = {}) ⇒ Object
-
#initialize(config) ⇒ PAC
constructor
A new instance of PAC.
- #international_letter_weight(params = {}) ⇒ Object
- #international_parcel_weight(params = {}) ⇒ Object
- #postage_letter_domestic_calculate(params = {}) ⇒ Object
- #postage_letter_domestic_service(params = {}) ⇒ Object
- #postage_letter_international_calculate(params = {}) ⇒ Object
- #postage_letter_international_service(params = {}) ⇒ Object
- #postage_parcel_domestic_calculate(params = {}) ⇒ Object
- #postage_parcel_domestic_service(params = {}) ⇒ Object
- #postage_parcel_international_calculate(params = {}) ⇒ Object
- #postage_parcel_international_service(params = {}) ⇒ Object
Constructor Details
#initialize(config) ⇒ PAC
Returns a new instance of PAC.
7 8 9 |
# File 'lib/aus_post_api/pac.rb', line 7 def initialize(config) @config = config end |
Instance Method Details
#country(params = {}) ⇒ Object
15 16 17 |
# File 'lib/aus_post_api/pac.rb', line 15 def country(params = {}) AusPostAPI::PAC::Country.new(params, @config).execute end |
#domestic_letter_size(params = {}) ⇒ Object
27 28 29 |
# File 'lib/aus_post_api/pac.rb', line 27 def domestic_letter_size(params = {}) AusPostAPI::PAC::DomesticLetterSize.new(params, @config).execute end |
#domestic_letter_thickness(params = {}) ⇒ Object
19 20 21 |
# File 'lib/aus_post_api/pac.rb', line 19 def domestic_letter_thickness(params = {}) AusPostAPI::PAC::DomesticLetterThickness.new(params, @config).execute end |
#domestic_letter_weight(params = {}) ⇒ Object
23 24 25 |
# File 'lib/aus_post_api/pac.rb', line 23 def domestic_letter_weight(params = {}) AusPostAPI::PAC::DomesticLetterWeight.new(params, @config).execute end |
#domestic_parcel_size(params = {}) ⇒ Object
47 48 49 |
# File 'lib/aus_post_api/pac.rb', line 47 def domestic_parcel_size(params = {}) AusPostAPI::PAC::DomesticParcelSize.new(params, @config).execute end |
#domestic_parcel_type(params = {}) ⇒ Object
43 44 45 |
# File 'lib/aus_post_api/pac.rb', line 43 def domestic_parcel_type(params = {}) AusPostAPI::PAC::DomesticParcelType.new(params, @config).execute end |
#domestic_parcel_weight(params = {}) ⇒ Object
39 40 41 |
# File 'lib/aus_post_api/pac.rb', line 39 def domestic_parcel_weight(params = {}) AusPostAPI::PAC::DomesticParcelWeight.new(params, @config).execute end |
#domestic_postcode_search(params = {}) ⇒ Object
11 12 13 |
# File 'lib/aus_post_api/pac.rb', line 11 def domestic_postcode_search(params = {}) AusPostAPI::PAC::DomesticPostcodeSearch.new(params, @config).execute end |
#international_letter_weight(params = {}) ⇒ Object
31 32 33 |
# File 'lib/aus_post_api/pac.rb', line 31 def international_letter_weight(params = {}) AusPostAPI::PAC::InternationalLetterWeight.new(params, @config).execute end |
#international_parcel_weight(params = {}) ⇒ Object
35 36 37 |
# File 'lib/aus_post_api/pac.rb', line 35 def international_parcel_weight(params = {}) AusPostAPI::PAC::InternationalParcelWeight.new(params, @config).execute end |
#postage_letter_domestic_calculate(params = {}) ⇒ Object
75 76 77 |
# File 'lib/aus_post_api/pac.rb', line 75 def postage_letter_domestic_calculate(params = {}) AusPostAPI::PAC::PostageLetterDomesticCalculate.new(params, @config).execute end |
#postage_letter_domestic_service(params = {}) ⇒ Object
51 52 53 |
# File 'lib/aus_post_api/pac.rb', line 51 def postage_letter_domestic_service(params = {}) AusPostAPI::PAC::PostageLetterDomesticService.new(params, @config).execute end |
#postage_letter_international_calculate(params = {}) ⇒ Object
79 80 81 |
# File 'lib/aus_post_api/pac.rb', line 79 def postage_letter_international_calculate(params = {}) AusPostAPI::PAC::PostageLetterInternationalCalculate.new(params, @config).execute end |
#postage_letter_international_service(params = {}) ⇒ Object
59 60 61 |
# File 'lib/aus_post_api/pac.rb', line 59 def postage_letter_international_service(params = {}) AusPostAPI::PAC::PostageLetterInternationalService.new(params, @config).execute end |
#postage_parcel_domestic_calculate(params = {}) ⇒ Object
67 68 69 |
# File 'lib/aus_post_api/pac.rb', line 67 def postage_parcel_domestic_calculate(params = {}) AusPostAPI::PAC::PostageParcelDomesticCalculate.new(params, @config).execute end |
#postage_parcel_domestic_service(params = {}) ⇒ Object
55 56 57 |
# File 'lib/aus_post_api/pac.rb', line 55 def postage_parcel_domestic_service(params = {}) AusPostAPI::PAC::PostageParcelDomesticService.new(params, @config).execute end |
#postage_parcel_international_calculate(params = {}) ⇒ Object
71 72 73 |
# File 'lib/aus_post_api/pac.rb', line 71 def postage_parcel_international_calculate(params = {}) AusPostAPI::PAC::PostageParcelInternationalCalculate.new(params, @config).execute end |
#postage_parcel_international_service(params = {}) ⇒ Object
63 64 65 |
# File 'lib/aus_post_api/pac.rb', line 63 def postage_parcel_international_service(params = {}) AusPostAPI::PAC::PostageParcelInternationalService.new(params, @config).execute end |