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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8eb0d906fd8e202e32d658fa475a74f7cc2afa95
4
- data.tar.gz: eb37f60091e909aad4138111d68963060f52b175
3
+ metadata.gz: 3c7363b11952e3797608201e34b0cc3db0579d65
4
+ data.tar.gz: 03e809611f47c92712a74694683274b099b6daef
5
5
  SHA512:
6
- metadata.gz: 976cfae6c807d0b97360cd5c9dbee3005f5b9b7d9f95ffd042f49829768983df2e4cbb22fe41f74c77f321b97a2fed0174434c43007f500bdfb4ccae1602ffff
7
- data.tar.gz: baa7bbf672be1a22357f5dd23e8fcb7bd90119b867455fa55a95c20014f5e0c41c314e9381bc21397665bea06ac13f0196a17275f766e488c8d41e05b153c2ab
6
+ metadata.gz: c69c1ae7eaa9cb783e55ebce5f8ba43ec1db5753f66848cd6aa2b8d8ba99572d2a80e3aa5a50276cccf1d5a5cdb3142e924ab4be6dfe8e9d484fae6dc8253ef2
7
+ data.tar.gz: 6a4f256aae9acf449e281928ba8980022583e836f4e1062c0576137f25f2a9fea70071fce076ed1040cc91c261f685ab56470f41c3dd1fe82ae25cea61379bf4
@@ -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(@endpoint[nil, options], 'id' => key).reload!
137
+ @klass.load @klass.endpoint[key, @endpoint[nil, options].options]
134
138
  else
135
139
  raise ArgumentError, 'invalid search value type'
136
140
  end
@@ -16,6 +16,7 @@ module Tickethub
16
16
  end
17
17
 
18
18
  def endpoint
19
+ return self.superclass.endpoint unless @path
19
20
  Tickethub.endpoint[@path, @options]
20
21
  end
21
22
 
@@ -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
@@ -3,6 +3,5 @@ require_relative '../message'
3
3
  module Tickethub
4
4
  class Supplier::Message::Email < Supplier::Message
5
5
  polymorphic 'email'
6
- path '/supplier/messages/email'
7
6
  end
8
7
  end
@@ -3,6 +3,5 @@ require_relative '../message'
3
3
  module Tickethub
4
4
  class Supplier::Message::SMS < Supplier::Message
5
5
  polymorphic 'sms'
6
- path '/supplier/messages/sms'
7
6
  end
8
7
  end
@@ -3,7 +3,6 @@ require_relative '../payment'
3
3
  module Tickethub
4
4
  class Supplier::Payment::Card < Supplier::Payment
5
5
  polymorphic 'card'
6
- path '/supplier/payments/card'
7
6
 
8
7
  require_relative '../card'
9
8
  require_relative '../../address'
@@ -3,6 +3,5 @@ require_relative '../payment'
3
3
  module Tickethub
4
4
  class Supplier::Payment::Cash < Supplier::Payment
5
5
  polymorphic 'cash'
6
- path '/supplier/payments/cash'
7
6
  end
8
7
  end
@@ -3,6 +3,5 @@ require_relative '../payment'
3
3
  module Tickethub
4
4
  class Supplier::Payment::Credit < Supplier::Payment
5
5
  polymorphic 'credit'
6
- path '/supplier/payments/credit'
7
6
  end
8
7
  end
@@ -3,6 +3,5 @@ require_relative '../payment'
3
3
  module Tickethub
4
4
  class Supplier::Payment::Direct < Supplier::Payment
5
5
  polymorphic 'direct'
6
- path '/supplier/payments/direct'
7
6
  end
8
7
  end
@@ -3,6 +3,5 @@ require_relative '../payment'
3
3
  module Tickethub
4
4
  class Supplier::Payment::Gratuity < Supplier::Payment
5
5
  polymorphic 'gratuity'
6
- path '/supplier/payments/gratuity'
7
6
  end
8
7
  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
@@ -13,6 +13,9 @@ module Tickethub
13
13
 
14
14
  collection :tickets, Supplier::Ticket
15
15
 
16
+ attribute :price, type: :money
17
+ attribute :total, type: :money
18
+
16
19
  attribute :created_at, type: :datetime
17
20
  attribute :updated_at, type: :datetime
18
21
  end
@@ -1,3 +1,3 @@
1
1
  module Tickethub
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
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.6
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-26 00:00:00.000000000 Z
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