esi 0.4.10 → 0.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8c09c5de1f74d9dc8a32eb532abc1db4eb88366d00362c07b377b3fd5c6fb9d
4
- data.tar.gz: 131b8a5a617ea29bb2e864c5452758bc52d5d273b858e31084d144fdf6d29151
3
+ metadata.gz: fb430aa853eb78502a147ecbf1ce98bea62e3b4cc73a0dc52f2d631f02ea63e9
4
+ data.tar.gz: 854da9127aa99dacd115959d4d6fbdefb3dd2ac8ff575939884761b205caf15a
5
5
  SHA512:
6
- metadata.gz: cef7bf5e2955de59fb9ffb6d05fc9ee2c45c10f6f002e8593b1760f91f369caba283675c207921de504b850244f84eb8d8b931742b7491112c5c617af7d13bf7
7
- data.tar.gz: 8e9b1a781c19c7b67d72895222a3f3363892c5fac430a014c6859f56a5bcc2472a823428137c069d13c8c978f27666f3ca193cec7e5804461efeaa777ca8037b
6
+ metadata.gz: 712ecc67eca7f966409ed3508def2251163be2a1db2d73d465b62f1733acb79ce962994a3d08b2d35fe8a52d63e560537d43fbab8a0b0bb48c399ece70cc2dca
7
+ data.tar.gz: 7a56bc5b831042e4f9be424ce1296c3010c4c12436718e6ff3dc13fd25853f3b23b787b81881aa1809b88a97ccfbf2ec538e917c929155bc2ab8d58ad0171503
@@ -12,7 +12,8 @@ module Esi
12
12
  class_attribute :scope
13
13
  class_attribute :cache_duration
14
14
 
15
- attr_accessor :path, :params
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
- self.params ||= {}
41
- self.params[:page] = page
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
- !@paginated
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
- (params || {}).each do |k, v|
66
+ params.each do |k, v|
57
67
  sorted[k] = v.respond_to?(:sort) ? v.sort : v
58
68
  end
59
69
  sorted.sort
@@ -3,6 +3,9 @@
3
3
  module Esi
4
4
  class Calls
5
5
  class StructureOrders < Base
6
+ self.scope = 'esi-markets.structure_markets.v1'
7
+ self.cache_duration = 300
8
+
6
9
  def initialize(structure_id:)
7
10
  @path = "/markets/structures/#{structure_id}"
8
11
  @paginated = true
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Esi
4
- VERSION = '0.4.10'
4
+ VERSION = '0.4.11'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.10
4
+ version: 0.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Hiemstra