eatabit_rails 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +44 -2
- data/eatabit_rails.gemspec +1 -1
- data/lib/eatabit_rails/job.rb +15 -1
- data/lib/eatabit_rails/printer.rb +13 -3
- data/lib/eatabit_rails/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 375ebeb798353226f644fa87999566d22a4ba94e
|
4
|
+
data.tar.gz: 82508d901933db31bc01f78f4c439ad45d78b92d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29099d35ddc5d778c026c25e8cfe4c347004d541673625b60d6b90e2867b57979931acada0aeaf844bb99a0b0f9f232c827a3928193f4a96cc780326729d73ec
|
7
|
+
data.tar.gz: ae8e50c9e5bc776187e17f0b4e0728ef19c672e8f24553598c9520fcea2a01aac3face0e6b65200ef1b01aed80edef6ebecd38675ff51b46d7c11d5a91ec5205
|
data/README.md
CHANGED
@@ -21,9 +21,51 @@ Or install it yourself as:
|
|
21
21
|
|
22
22
|
$ gem install eatabit_rails
|
23
23
|
|
24
|
-
##
|
24
|
+
## Configure
|
25
|
+
|
26
|
+
Create an initializer like: config/initializers/eatabit.rb
|
27
|
+
|
28
|
+
```
|
29
|
+
EatabitRails.configure do |config|
|
30
|
+
config.sid = ENV.fetch('EATABIT_SID')
|
31
|
+
config.token = ENV.fetch('EATABIT_TOKEN')
|
32
|
+
config.version = 'v2'
|
33
|
+
end
|
34
|
+
|
35
|
+
```
|
36
|
+
|
37
|
+
## Create a Job
|
38
|
+
The full API Job spec can be found [here](http://eatabit.io/documentation/v2/job-create.html)
|
39
|
+
|
40
|
+
```
|
41
|
+
EatabitRails::Job.create(printer_id, job_data)
|
42
|
+
```
|
43
|
+
|
44
|
+
## Show a Job
|
45
|
+
The full API Job spec can be found [here](http://eatabit.io/documentation/v2/job-read.html)
|
46
|
+
|
47
|
+
```
|
48
|
+
EatabitRails::Job.find(printer_id, job_id)
|
49
|
+
```
|
50
|
+
|
51
|
+
## Show a Printer
|
52
|
+
The full API Printer spec can be found [here](http://eatabit.io/documentation/v2/printer-read.html)
|
53
|
+
|
54
|
+
```
|
55
|
+
EatabitRails::Account(printer_id)
|
56
|
+
```
|
57
|
+
|
58
|
+
## Show an Account
|
59
|
+
The full API Account spec can be found [here](http://eatabit.io/documentation/v2/account-read.html)
|
60
|
+
|
61
|
+
```
|
62
|
+
EatabitRails::Account.find
|
63
|
+
```
|
64
|
+
|
65
|
+
## More Information
|
66
|
+
|
67
|
+
The full API spec can be found [here](http://eatabit.io/documentation/v2).
|
25
68
|
|
26
|
-
TODO: Write usage instructions here
|
27
69
|
|
28
70
|
## Development
|
29
71
|
|
data/eatabit_rails.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
spec.summary = %q{The official gem for the eatabit.io API}
|
13
13
|
spec.description = %q{Taking orders online is easy. (ok, not that easy) but getting the order into the hands of the restaurant...that's hard.}
|
14
|
-
spec.homepage = "
|
14
|
+
spec.homepage = "https://github.com/eatabit/eatabit_rails"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
data/lib/eatabit_rails/job.rb
CHANGED
@@ -3,6 +3,7 @@ module EatabitRails
|
|
3
3
|
class Job
|
4
4
|
|
5
5
|
attr_reader :id,
|
6
|
+
:external_id,
|
6
7
|
:body,
|
7
8
|
:state,
|
8
9
|
:environment,
|
@@ -10,10 +11,17 @@ module EatabitRails
|
|
10
11
|
:delivery_minutes,
|
11
12
|
:status_url,
|
12
13
|
:status_url_method,
|
13
|
-
:created_at
|
14
|
+
:created_at,
|
15
|
+
:fulfill_at,
|
16
|
+
:api_version,
|
17
|
+
:expire_seconds,
|
18
|
+
:expires_at,
|
19
|
+
:account,
|
20
|
+
:printer
|
14
21
|
|
15
22
|
def initialize(attributes)
|
16
23
|
@id = attributes['id']
|
24
|
+
@external_id = attributes['external_id']
|
17
25
|
@body = attributes['body']
|
18
26
|
@state = attributes['state']
|
19
27
|
@environment = attributes['environment']
|
@@ -22,6 +30,12 @@ module EatabitRails
|
|
22
30
|
@status_url = attributes['status_url']
|
23
31
|
@status_url_method = attributes['status_url_method']
|
24
32
|
@created_at = attributes['created_at']
|
33
|
+
@fulfill_at = attributes['fulfill_at']
|
34
|
+
@api_version = attributes['api_version']
|
35
|
+
@expire_seconds = attributes['expire_seconds']
|
36
|
+
@expires_at = attributes['expires_at']
|
37
|
+
@account = attributes['account']
|
38
|
+
@printer = attributes['printer']
|
25
39
|
end
|
26
40
|
|
27
41
|
def self.create(printer_id, job_attributes)
|
@@ -2,22 +2,32 @@ module EatabitRails
|
|
2
2
|
|
3
3
|
class Printer
|
4
4
|
|
5
|
-
attr_reader :
|
5
|
+
attr_reader :id,
|
6
|
+
:name,
|
6
7
|
:enabled,
|
7
8
|
:pickup_minutes,
|
8
9
|
:delivery_minutes,
|
9
10
|
:state,
|
10
11
|
:online,
|
11
|
-
:
|
12
|
+
:paper,
|
13
|
+
:fulfillment,
|
14
|
+
:sound,
|
15
|
+
:light,
|
16
|
+
:autoprint
|
12
17
|
|
13
18
|
def initialize(attributes)
|
19
|
+
@id = attributes['id']
|
14
20
|
@name = attributes['name']
|
15
21
|
@enabled = attributes['enabled']
|
16
22
|
@pickup_minutes = attributes['pickup_minutes']
|
17
23
|
@delivery_minutes = attributes['delivery_minutes']
|
18
24
|
@state = attributes['state']
|
19
25
|
@online = attributes['online']
|
20
|
-
@
|
26
|
+
@paper = attributes['paper']
|
27
|
+
@fulfillment = attributes['fulfillment']
|
28
|
+
@sound = attributes['sound']
|
29
|
+
@light = attributes['light']
|
30
|
+
@autoprint = attributes['autoprint']
|
21
31
|
end
|
22
32
|
|
23
33
|
def self.find(id)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eatabit_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Oleksiak
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -164,7 +164,7 @@ files:
|
|
164
164
|
- lib/eatabit_rails/rest/uri.rb
|
165
165
|
- lib/eatabit_rails/util/configuration.rb
|
166
166
|
- lib/eatabit_rails/version.rb
|
167
|
-
homepage:
|
167
|
+
homepage: https://github.com/eatabit/eatabit_rails
|
168
168
|
licenses:
|
169
169
|
- MIT
|
170
170
|
metadata:
|