tickethub 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tickethub/collection.rb +5 -1
- data/lib/tickethub/resource.rb +1 -0
- data/lib/tickethub/supplier/booking.rb +3 -7
- data/lib/tickethub/supplier/booking/ticket.rb +12 -0
- data/lib/tickethub/supplier/booking/voucher.rb +12 -0
- data/lib/tickethub/supplier/message/email.rb +0 -1
- data/lib/tickethub/supplier/message/sms.rb +0 -1
- data/lib/tickethub/supplier/payment/card.rb +0 -1
- data/lib/tickethub/supplier/payment/cash.rb +0 -1
- data/lib/tickethub/supplier/payment/credit.rb +0 -1
- data/lib/tickethub/supplier/payment/direct.rb +0 -1
- data/lib/tickethub/supplier/payment/gratuity.rb +0 -1
- data/lib/tickethub/supplier/subscription.rb +4 -0
- data/lib/tickethub/supplier/voucher.rb +3 -0
- data/lib/tickethub/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c7363b11952e3797608201e34b0cc3db0579d65
|
4
|
+
data.tar.gz: 03e809611f47c92712a74694683274b099b6daef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c69c1ae7eaa9cb783e55ebce5f8ba43ec1db5753f66848cd6aa2b8d8ba99572d2a80e3aa5a50276cccf1d5a5cdb3142e924ab4be6dfe8e9d484fae6dc8253ef2
|
7
|
+
data.tar.gz: 6a4f256aae9acf449e281928ba8980022583e836f4e1062c0576137f25f2a9fea70071fce076ed1040cc91c261f685ab56470f41c3dd1fe82ae25cea61379bf4
|
data/lib/tickethub/collection.rb
CHANGED
@@ -46,6 +46,10 @@ module Tickethub
|
|
46
46
|
.collect { |value| value[0].to_i } : [@cache.length, 0, @cache.length]
|
47
47
|
end
|
48
48
|
|
49
|
+
def last
|
50
|
+
offset(count - 1).first
|
51
|
+
end
|
52
|
+
|
49
53
|
def limit(value = nil)
|
50
54
|
if value.nil?
|
51
55
|
reload! if @limit.nil?
|
@@ -130,7 +134,7 @@ module Tickethub
|
|
130
134
|
self.offset(key.min).first(key.max)
|
131
135
|
when String
|
132
136
|
options = { params: args[1] || {} }.merge args[2] || {}
|
133
|
-
@klass.load
|
137
|
+
@klass.load @klass.endpoint[key, @endpoint[nil, options].options]
|
134
138
|
else
|
135
139
|
raise ArgumentError, 'invalid search value type'
|
136
140
|
end
|
data/lib/tickethub/resource.rb
CHANGED
@@ -4,18 +4,17 @@ module Tickethub
|
|
4
4
|
class Supplier::Booking < Resource
|
5
5
|
path '/supplier/bookings'
|
6
6
|
|
7
|
+
require_relative 'booking/ticket'
|
8
|
+
require_relative 'booking/voucher'
|
9
|
+
|
7
10
|
require_relative 'rate'
|
8
11
|
require_relative 'order'
|
9
|
-
require_relative 'ticket'
|
10
|
-
require_relative 'voucher'
|
11
12
|
require_relative 'answer'
|
12
13
|
require_relative 'product'
|
13
14
|
require_relative 'variant'
|
14
15
|
require_relative 'message'
|
15
16
|
require_relative 'fee'
|
16
17
|
|
17
|
-
collection :tickets, Supplier::Ticket
|
18
|
-
collection :vouchers, Supplier::Voucher
|
19
18
|
collection :answers, Supplier::Answer
|
20
19
|
collection :messages, Supplier::Message
|
21
20
|
collection :fees, Supplier::Fee
|
@@ -31,9 +30,6 @@ module Tickethub
|
|
31
30
|
attribute :total, type: :money
|
32
31
|
|
33
32
|
attribute :currency, type: :currency
|
34
|
-
attribute :valid_from, type: :datetime
|
35
|
-
attribute :expires_at, type: :datetime
|
36
|
-
attribute :timeout_at, type: :datetime
|
37
33
|
attribute :created_at, type: :datetime
|
38
34
|
attribute :updated_at, type: :datetime
|
39
35
|
attribute :cancelled_at, type: :datetime
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require_relative '../booking'
|
2
|
+
|
3
|
+
module Tickethub
|
4
|
+
class Supplier::Booking::Ticket < Supplier::Booking
|
5
|
+
polymorphic 'ticket'
|
6
|
+
|
7
|
+
require_relative '../ticket'
|
8
|
+
|
9
|
+
collection :tickets, Supplier::Ticket
|
10
|
+
attribute :valid_from, type: :datetime
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require_relative '../booking'
|
2
|
+
|
3
|
+
module Tickethub
|
4
|
+
class Supplier::Booking::Voucher < Supplier::Booking
|
5
|
+
polymorphic 'voucher'
|
6
|
+
|
7
|
+
require_relative '../voucher'
|
8
|
+
|
9
|
+
collection :vouchers, Supplier::Voucher
|
10
|
+
attribute :expires_on, type: :date
|
11
|
+
end
|
12
|
+
end
|
@@ -5,7 +5,11 @@ module Tickethub
|
|
5
5
|
path '/supplier/subscriptions'
|
6
6
|
|
7
7
|
require_relative 'package'
|
8
|
+
require_relative 'user'
|
9
|
+
require_relative '../token'
|
8
10
|
|
9
11
|
association :package, Supplier::Package
|
12
|
+
association :user, Supplier::User
|
13
|
+
association :token, Token
|
10
14
|
end
|
11
15
|
end
|
data/lib/tickethub/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tickethub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oliver Morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -138,6 +138,8 @@ files:
|
|
138
138
|
- lib/tickethub/supplier/app.rb
|
139
139
|
- lib/tickethub/supplier/bill.rb
|
140
140
|
- lib/tickethub/supplier/booking.rb
|
141
|
+
- lib/tickethub/supplier/booking/ticket.rb
|
142
|
+
- lib/tickethub/supplier/booking/voucher.rb
|
141
143
|
- lib/tickethub/supplier/card.rb
|
142
144
|
- lib/tickethub/supplier/coupon.rb
|
143
145
|
- lib/tickethub/supplier/customer.rb
|