tickethub 0.2.15 → 0.2.17

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: 4d740bf7ed5f7a47130cc0783c2ef8c3e8c98449
4
- data.tar.gz: ca924857562d5cd52860c3f9ec7f4b4915ecaba9
3
+ metadata.gz: fc4b1ae7735876c0a2a4bf3efae57c4e7552983f
4
+ data.tar.gz: 9f6dbfbb13e650b094f2a1d46fff1f95392da3a2
5
5
  SHA512:
6
- metadata.gz: 53b7881f0883094d37fab9556dc0401561f132d008b54dc39b717d2127b4a1744b4fb668107acdafef84f71ea29b2efc240df03897c0cf06f4ad349087acc88b
7
- data.tar.gz: 18a9e93c970c0aa7b9cb2176cc0f4afe9a07186ad127ade65d3bc40f2c6622506e04b36a560a56ca533e24805352fef070238d2d4883ee2aa6a6bf65238660a5
6
+ metadata.gz: bd943c19b3730c0246cc3cc955fbc45945997752f4d739bb326d2d0e9a3119d9a17d37e1b9743213e0a37342725c29439694ffe2fd307b1bf81cc12eaff4aec2
7
+ data.tar.gz: deb0a6a9e26a10321f0ced7f35c19736bccfbe98a91efb13b7d5ae074c9f967e38d33c5a0b452dcfd5441f29fafcba1e9911549fd92640bd678e45a673947eff
@@ -3,6 +3,10 @@ require_relative 'helpers'
3
3
 
4
4
  module Tickethub
5
5
  class Collection < Enumerator
6
+
7
+ DEFAULT_LIMIT = 25.freeze
8
+ DEFAULT_OFFSET = 0.freeze
9
+
6
10
  attr_accessor :cache
7
11
  attr_reader :count, :endpoint, :params
8
12
 
@@ -53,8 +57,7 @@ module Tickethub
53
57
 
54
58
  def limit(value = nil)
55
59
  if value.nil?
56
- reload! if @limit.nil?
57
- return @limit
60
+ return (@limit || params[:offset] || DEFAULT_LIMIT).to_i
58
61
  else
59
62
  self.class.new endpoint, @klass,
60
63
  params.merge(limit: value)
@@ -63,8 +66,7 @@ module Tickethub
63
66
 
64
67
  def offset(value = nil)
65
68
  if value.nil?
66
- reload! if @offset.nil?
67
- return @offset
69
+ return (@offset || params[:offset] || DEFAULT_OFFSET).to_i
68
70
  else
69
71
  self.class.new endpoint, @klass,
70
72
  params.merge(offset: value)
@@ -124,11 +126,6 @@ module Tickethub
124
126
  block_given?? super : ! empty?
125
127
  end
126
128
 
127
- def limit
128
- self.reload! if @limit.nil?
129
- return @limit
130
- end
131
-
132
129
  def count
133
130
  self.reload! if @count.nil?
134
131
  return @count
@@ -17,7 +17,5 @@ module Tickethub
17
17
  collection :messages, Supplier::Message
18
18
 
19
19
  association :address, Tickethub::Address
20
-
21
- attribute :revenue, type: :money
22
20
  end
23
21
  end
@@ -1,3 +1,3 @@
1
1
  module Tickethub
2
- VERSION = '0.2.15'
2
+ VERSION = '0.2.17'
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.2.15
4
+ version: 0.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Morgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-01 00:00:00.000000000 Z
11
+ date: 2015-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  version: '0'
178
178
  requirements: []
179
179
  rubyforge_project:
180
- rubygems_version: 2.2.1
180
+ rubygems_version: 2.4.5
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: API client for tickethub.io