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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af7c6a247863353961428931de7c84ea63f3441b
4
- data.tar.gz: b5d338efdbbef71ea854b7b0b15f6c678b3a4a7f
3
+ metadata.gz: 2e727ca39de0c3c5820f5e84b3fce99ff189e0cc
4
+ data.tar.gz: 289fefbdf8f0632cd664fb455b11a3bb60046e65
5
5
  SHA512:
6
- metadata.gz: 955b77d96e5e720e8fb4f96d3859a25ddef1f905d0fd804f15208109ef1eeebb090281490ad1c054e5da9d80ef87e7cdfd3e250342eeba532948d9cd998222d3
7
- data.tar.gz: 8a1aa668fa1fa92af9f5e5d5281a449b4a0102aae9cc8a5f7b5bc049779a7ae76daea655165ae4cb9151058b2218c7a826ea0ce2e1cd0f2d5e9945bee776b4f3
6
+ metadata.gz: c3f9c426088c3d223bc4be4430f6b641050a269f114875e333fb0109a07cc6fbacd15cf7b939b15101057311b0a8bbb48e51aa5fe943dabbb7b800e86e328359
7
+ data.tar.gz: 03ab3eb931de5d7d83e3752891d1385559c33e1318350178fc4b8b79022107256be70de00075b337505d5a3a4b710f634d2c242a08c27f56f2c56987a6f73f05
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # Aupost
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/aupost`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- $ client = Aupost::Client.new("YOUR AUPOST KEY HERE")
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
- $ client.domestic_postcode_search("can")
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/[my-github-username]/aupost/fork )
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`)
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Aupost
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  AUPOST_URL = "https://auspost.com.au/api"
4
4
 
5
5
  end
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.2
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-26 00:00:00.000000000 Z
11
+ date: 2015-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler