esi 0.4.10 → 0.4.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/esi/calls/base.rb +15 -5
- data/lib/esi/calls/markets.rb +3 -0
- data/lib/esi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb430aa853eb78502a147ecbf1ce98bea62e3b4cc73a0dc52f2d631f02ea63e9
|
4
|
+
data.tar.gz: 854da9127aa99dacd115959d4d6fbdefb3dd2ac8ff575939884761b205caf15a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 712ecc67eca7f966409ed3508def2251163be2a1db2d73d465b62f1733acb79ce962994a3d08b2d35fe8a52d63e560537d43fbab8a0b0bb48c399ece70cc2dca
|
7
|
+
data.tar.gz: 7a56bc5b831042e4f9be424ce1296c3010c4c12436718e6ff3dc13fd25853f3b23b787b81881aa1809b88a97ccfbf2ec538e917c929155bc2ab8d58ad0171503
|
data/lib/esi/calls/base.rb
CHANGED
@@ -12,7 +12,8 @@ module Esi
|
|
12
12
|
class_attribute :scope
|
13
13
|
class_attribute :cache_duration
|
14
14
|
|
15
|
-
attr_accessor :path
|
15
|
+
attr_accessor :path
|
16
|
+
attr_writer :params
|
16
17
|
|
17
18
|
# Returns an unique key based on the endpoint and params which is used for caching
|
18
19
|
# @return [String] cache key
|
@@ -37,14 +38,23 @@ module Esi
|
|
37
38
|
|
38
39
|
# @param page [Integer] page number
|
39
40
|
def page=(page)
|
40
|
-
|
41
|
-
|
41
|
+
params[:page] = page
|
42
|
+
end
|
43
|
+
|
44
|
+
# @return [Integer] page number
|
45
|
+
def page
|
46
|
+
params[:page] || 1
|
42
47
|
end
|
43
48
|
|
44
49
|
# Returns whether the endpoint supports pagination
|
45
50
|
# @return [Boolean]
|
46
51
|
def paginated?
|
47
|
-
|
52
|
+
@paginated
|
53
|
+
end
|
54
|
+
|
55
|
+
# @return [Hash] request params
|
56
|
+
def params
|
57
|
+
@params || {}
|
48
58
|
end
|
49
59
|
|
50
60
|
private
|
@@ -53,7 +63,7 @@ module Esi
|
|
53
63
|
# @return [Array] sorted array of params
|
54
64
|
def sorted_params
|
55
65
|
sorted = {}
|
56
|
-
|
66
|
+
params.each do |k, v|
|
57
67
|
sorted[k] = v.respond_to?(:sort) ? v.sort : v
|
58
68
|
end
|
59
69
|
sorted.sort
|
data/lib/esi/calls/markets.rb
CHANGED
data/lib/esi/version.rb
CHANGED