aupost 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -5
- data/lib/aupost.rb +38 -0
- data/lib/aupost/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e727ca39de0c3c5820f5e84b3fce99ff189e0cc
|
4
|
+
data.tar.gz: 289fefbdf8f0632cd664fb455b11a3bb60046e65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3f9c426088c3d223bc4be4430f6b641050a269f114875e333fb0109a07cc6fbacd15cf7b939b15101057311b0a8bbb48e51aa5fe943dabbb7b800e86e328359
|
7
|
+
data.tar.gz: 03ab3eb931de5d7d83e3752891d1385559c33e1318350178fc4b8b79022107256be70de00075b337505d5a3a4b710f634d2c242a08c27f56f2c56987a6f73f05
|
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# Aupost
|
2
2
|
|
3
|
-
|
3
|
+
This is a JSON warapper for Auspost API. Please refer to the details spec here:
|
4
|
+
|
5
|
+
https://developers.auspost.com.au/apis/pac/reference
|
4
6
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
@@ -22,9 +23,13 @@ Or install it yourself as:
|
|
22
23
|
|
23
24
|
## Usage
|
24
25
|
|
25
|
-
|
26
|
+
$ client = Aupost::Client.new("YOUR AUPOST KEY HERE")
|
27
|
+
|
28
|
+
$ client.domestic_postcode_search("can")
|
29
|
+
|
30
|
+
$ client.domestic_postcode_search("canning vale", "WA")
|
26
31
|
|
27
|
-
|
32
|
+
$ client.country
|
28
33
|
|
29
34
|
## Development
|
30
35
|
|
@@ -34,7 +39,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
34
39
|
|
35
40
|
## Contributing
|
36
41
|
|
37
|
-
1. Fork it ( https://github.com/
|
42
|
+
1. Fork it ( https://github.com/tscung/aupost/fork )
|
38
43
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
39
44
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
40
45
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/aupost.rb
CHANGED
@@ -23,6 +23,44 @@ module Aupost
|
|
23
23
|
call URI("#{Aupost::AUPOST_URL}/postage/country.json")
|
24
24
|
end
|
25
25
|
|
26
|
+
def domestic_letter_thickness
|
27
|
+
call URI("#{Aupost::AUPOST_URL}/postage/letter/domestic/thickness.json")
|
28
|
+
end
|
29
|
+
|
30
|
+
def domestic_letter_weight
|
31
|
+
call URI("#{Aupost::AUPOST_URL}/postage/letter/domestic/weight.json")
|
32
|
+
end
|
33
|
+
|
34
|
+
def domestic_letter_size
|
35
|
+
call URI("#{Aupost::AUPOST_URL}/postage/letter/domestic/size.json")
|
36
|
+
end
|
37
|
+
|
38
|
+
def international_letter_weight
|
39
|
+
call URI("#{Aupost::AUPOST_URL}/postage/letter/international/weight.json")
|
40
|
+
end
|
41
|
+
|
42
|
+
def international_parcel_weight
|
43
|
+
call URI("#{Aupost::AUPOST_URL}/postage/parcel/international/size.json")
|
44
|
+
end
|
45
|
+
|
46
|
+
def domestic_parcel_weight
|
47
|
+
call URI("#{Aupost::AUPOST_URL}/postage/parcel/domestic/weight.json")
|
48
|
+
end
|
49
|
+
|
50
|
+
def domestic_parcel_type
|
51
|
+
call URI("#{Aupost::AUPOST_URL}/postage/parcel/domestic/type.json")
|
52
|
+
end
|
53
|
+
|
54
|
+
def domestic_parcel_type
|
55
|
+
call URI("#{Aupost::AUPOST_URL}/postage/parcel/domestic/size.json")
|
56
|
+
end
|
57
|
+
|
58
|
+
def postage_letter_domestic_service
|
59
|
+
call URI("#{Aupost::AUPOST_URL}/postage/parcel/domestic/size.json")
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
|
26
64
|
def call(uri)
|
27
65
|
req = Net::HTTP::Get.new(uri)
|
28
66
|
req['AUTH-KEY'] = @aupost_key
|
data/lib/aupost/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aupost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyson Cung
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|