omnivore-io 0.0.2 → 0.0.3
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/lib/omnivore-io/api/ticket.rb +19 -2
- data/lib/omnivore-io/api/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: f1eabca738600a4553f5d91256d720a94ee4dab4
|
4
|
+
data.tar.gz: f71d07bb0af748bef764269cd8894fe485fd6bac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb49444d4a5bf2ce2871f4f6f3ee636e607bc656ee6d368764c0015c020b539bdaa0de14919313ffe920ed2c423b3cd8d06c92257a0fdf664aca303d2e0b51c3
|
7
|
+
data.tar.gz: 95075e6aa7eba5560b542f272a2cecdde1d92ff834b33d0686032bc854a64c59d160953faa5db62523b6ca770f411bee6ae1ff266400dc2b7e7e67e88bdde5fd
|
@@ -1,10 +1,24 @@
|
|
1
1
|
module OmnivoreIO
|
2
|
+
class TicketItem
|
3
|
+
include OmnivoreObject
|
4
|
+
|
5
|
+
json_attr_accessor :menu_item, :quantity, :modifiers, :sent
|
6
|
+
|
7
|
+
def initialize(attributes={})
|
8
|
+
self.quantity = attributes['quantity']
|
9
|
+
self.sent = attributes['sent']
|
10
|
+
self.menu_item = OmnivoreIO::MenuItem.new(nil, attributes['_embedded']['menu_item'])
|
11
|
+
self.modifiers = (attributes['modifiers'] || []).map{|modifier_json| OmnivoreIO::Modifier.new(nil, modifier_json) }
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
|
2
16
|
class Ticket
|
3
17
|
include OmnivoreObject
|
4
18
|
|
5
|
-
attr_accessor :client
|
19
|
+
attr_accessor :client
|
6
20
|
json_attr_accessor :id, :location_id, :auto_send, :closed_at,
|
7
|
-
:guest_count, :name, :open, :opened_at, :ticket_number, :totals, :employee, :order_type, :revenue_center
|
21
|
+
:guest_count, :name, :open, :opened_at, :void, :ticket_number, :totals, :employee, :order_type, :revenue_center, :items
|
8
22
|
|
9
23
|
def initialize(client, attributes={})
|
10
24
|
self.client = client
|
@@ -14,6 +28,9 @@ module OmnivoreIO
|
|
14
28
|
self.send "#{key}=".to_sym, value
|
15
29
|
end
|
16
30
|
end
|
31
|
+
(attributes['_embedded']['items'] || []).each do |item_json|
|
32
|
+
self.items << OmnivoreIO::TicketItem.new(item_json)
|
33
|
+
end
|
17
34
|
end
|
18
35
|
|
19
36
|
def open!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omnivore-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zane Shannon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest_client
|
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
65
|
version: '0'
|
66
66
|
requirements: []
|
67
67
|
rubyforge_project:
|
68
|
-
rubygems_version: 2.4.
|
68
|
+
rubygems_version: 2.4.8
|
69
69
|
signing_key:
|
70
70
|
specification_version: 4
|
71
71
|
summary: Ruby Client for the Omnivore.io API
|