postmen 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -33
- data/lib/postmen/shipper_account.rb +1 -0
- data/lib/postmen/types.rb +8 -0
- data/lib/postmen/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: 8ad6ad295b262d6c51e17eae0742c3dfc97ea0fe
|
4
|
+
data.tar.gz: '0487c46ddffadbf35c670fcb1acbe3ac4bb07172'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eacc06fc16b9950fadbbd2ad7319c80a2d352591e4b1067e9e78e602cccf3ac104c4093cb94a397b5d75f87c479ed164625551a0b214feea21808c1f88c69752
|
7
|
+
data.tar.gz: 619b65d837e064cb336968b9fa749b027bd3ec0e11579e0389844f20130eb32c5b00018ef8e7afeebf51317a7c80d55f447e805d4aea707eb9a1424eb052ba6f
|
data/README.md
CHANGED
@@ -12,10 +12,11 @@ Ruby Gem for Postmen API.
|
|
12
12
|
|
13
13
|
This extension helps developers to integrate with Postmen easily.
|
14
14
|
|
15
|
-
##
|
16
|
-
|
17
|
-
This gem is on early stage of development - There are a lot of features that are not covered yet, you may also expect heavy changes in the public API, before we hit version `1.0.0` (see the Milestones section)
|
15
|
+
## Resources
|
18
16
|
|
17
|
+
- <a href="https://docs.postmen.com"> API documentation/overview</a>
|
18
|
+
- <a href="https://github.com/krzyzak/postmen-example-app/"> Example App</a>
|
19
|
+
- <a href="http://www.rubydoc.info/github/postmen/postmen-sdk-ruby">Ruby technical documentation</a>
|
19
20
|
|
20
21
|
|
21
22
|
## Installation
|
@@ -23,7 +24,7 @@ This gem is on early stage of development - There are a lot of features that are
|
|
23
24
|
1. Add the following line to your application's Gemfile
|
24
25
|
|
25
26
|
```
|
26
|
-
gem
|
27
|
+
gem 'postmen', '~> 1.0'
|
27
28
|
```
|
28
29
|
|
29
30
|
2. Run bundler
|
@@ -44,12 +45,13 @@ end
|
|
44
45
|
|
45
46
|
```
|
46
47
|
|
47
|
-
##
|
48
|
+
## Getting started
|
48
49
|
|
49
50
|
```ruby
|
50
51
|
require 'postmen'
|
51
52
|
|
52
|
-
#
|
53
|
+
# Setup your postmen account (https://postmen.com), obtain an API key.
|
54
|
+
# Configure Postmen, see Configuration section
|
53
55
|
|
54
56
|
### Fetch all labels:
|
55
57
|
|
@@ -66,33 +68,6 @@ Postmen::Label.all(status: 'created')
|
|
66
68
|
Postmen::Label.find('1111') # Returns an instance of Postmen::Label
|
67
69
|
```
|
68
70
|
|
69
|
-
### Label
|
70
|
-
|
71
|
-
An instance of `Postmen::Label` responds to following methods:
|
72
|
-
|
73
|
-
`id`,
|
74
|
-
`status`,
|
75
|
-
`tracking_numbers`
|
76
|
-
`files`,
|
77
|
-
`rate`
|
78
|
-
|
79
|
-
### LabelCollection
|
80
|
-
|
81
|
-
`Postmen::LabelCollection` acts as an Array of `Label` instances. You can do things like:
|
82
|
-
|
83
|
-
```ruby
|
84
|
-
collection = Postmen::Label.all
|
85
|
-
|
86
|
-
collection.first # Returns an instance of Label
|
87
|
-
collection.size # Returns number of elements returned
|
88
|
-
collection.each{|label| puts label.inspect } # Iterates over labels
|
89
|
-
collection.select{|label| } # Selects labels by given criteria
|
90
|
-
```
|
91
|
-
and so on.
|
92
|
-
|
93
71
|
## The License (MIT)
|
94
72
|
|
95
73
|
Released under the MIT license. See the LICENSE file for the complete wording.
|
96
|
-
|
97
|
-
|
98
|
-
## Contributor
|
@@ -6,6 +6,7 @@ class Postmen
|
|
6
6
|
attribute :id, Types::UUID
|
7
7
|
attribute :address, Types::Address
|
8
8
|
attribute :slug, Types::String
|
9
|
+
attribute :status, Types::ShipperAccountStatus
|
9
10
|
attribute :description, Types::String
|
10
11
|
attribute :type, Types::ShipperAccountTypes
|
11
12
|
attribute :timezone, Types::Timezone
|
data/lib/postmen/types.rb
CHANGED
@@ -38,8 +38,16 @@ class Postmen
|
|
38
38
|
'residential'
|
39
39
|
)
|
40
40
|
|
41
|
+
# List of possible Shipper Account Statuses
|
42
|
+
ShipperAccountStatus = Types::String.enum(
|
43
|
+
'enabled',
|
44
|
+
'disabled',
|
45
|
+
'deleted'
|
46
|
+
)
|
47
|
+
|
41
48
|
# List of possible Shipper Account Types
|
42
49
|
ShipperAccountTypes = Types::String.enum(
|
50
|
+
'default',
|
43
51
|
'user',
|
44
52
|
'user_prepaid'
|
45
53
|
)
|
data/lib/postmen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postmen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- postmen.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|