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 +4 -4
- data/lib/tickethub/collection.rb +6 -9
- data/lib/tickethub/supplier/customer.rb +0 -2
- data/lib/tickethub/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: fc4b1ae7735876c0a2a4bf3efae57c4e7552983f
|
4
|
+
data.tar.gz: 9f6dbfbb13e650b094f2a1d46fff1f95392da3a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd943c19b3730c0246cc3cc955fbc45945997752f4d739bb326d2d0e9a3119d9a17d37e1b9743213e0a37342725c29439694ffe2fd307b1bf81cc12eaff4aec2
|
7
|
+
data.tar.gz: deb0a6a9e26a10321f0ced7f35c19736bccfbe98a91efb13b7d5ae074c9f967e38d33c5a0b452dcfd5441f29fafcba1e9911549fd92640bd678e45a673947eff
|
data/lib/tickethub/collection.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
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.2.
|
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-
|
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.
|
180
|
+
rubygems_version: 2.4.5
|
181
181
|
signing_key:
|
182
182
|
specification_version: 4
|
183
183
|
summary: API client for tickethub.io
|