runa-ruby-client 0.2.1 → 0.3.1

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: 5367c11c00b8b54fa088fbc17169825fc9b33ca251265ae5b5793b0f113ebe42
4
- data.tar.gz: fb397d978bb48d75510bea9b5603e17f2432afe5cf884a4b45d8919fd87c8ac2
3
+ metadata.gz: '049e75e5f7056aa08f746351e525a21772c2c58e278ae599cf020899550262e8'
4
+ data.tar.gz: 743b89f8cfbc366a131f647a4550ccd3a2db97d453e7803d3d0ff4411231ea26
5
5
  SHA512:
6
- metadata.gz: 4ff382da0d1582524b28e688e80d5656606d321c53c53f1f0d783d9be49b32ef315cdebf6314327de1f277b7efc97a5e0c35ebd2fd9f8e2eeb028a8dcf98e1e6
7
- data.tar.gz: 1c81d4a81933b7e0c445cc94d1e79da4707b8285228540da46a35ffcc7418b1022659686f9d4c8d898afaacefacefd26952263d0370f143cc63f615cf5012162
6
+ metadata.gz: 9e2a893018ca7e2a1f56cc03917e1334acf2ed6dd7a51fea39fe83f7a10d28744c0827c7dea8c03dde2b9d605edc6671a51648455927390cbfdfa21dbb625303
7
+ data.tar.gz: 34a0bd4524b5ebc269866fdecd58631c2b6bfa886d3d9c1a32beac039e9b8eb2c89109cc050e9f65a4506067bcbc970dcb5d937ddda09167a0f92f57892b898d
@@ -22,6 +22,7 @@ class Runa::Product < Runa::Response
22
22
  :name,
23
23
  :minimum_value,
24
24
  :maximum_value,
25
+ :payout_type,
25
26
  :redeem_instructions_url,
26
27
  :state,
27
28
  :nonsense,
@@ -8,8 +8,24 @@ class Runa::Products < Runa::Response
8
8
  # Product Details List
9
9
  # GET /v2/product
10
10
  def get(ctx)
11
- response = ctx.request(:get, PATH, {}, '')
12
- parse(response)
11
+ @all = []
12
+ @after_key = nil
13
+
14
+ loop do
15
+ options = {}
16
+ if !@after_key.nil?
17
+ options = {
18
+ after: @after_key
19
+ }
20
+ end
21
+ response = ctx.request(:get, PATH, options, '')
22
+ parse(response)
23
+ if @after_key.nil?
24
+ break
25
+ end
26
+ end
27
+
28
+ self
13
29
  end
14
30
 
15
31
  # Find all products by fieldname.
@@ -23,12 +39,13 @@ class Runa::Products < Runa::Response
23
39
  if is_successful?
24
40
  # TODO: separate?
25
41
  if @payload['catalog']
26
- @all = @payload['catalog'].map { |p| Runa::Product.new(p) }
42
+ products = @payload['catalog']
43
+ products.delete_if { |product| !product['payout_type'].eql? 'gift_card'.freeze }
44
+ @all.concat(@payload['catalog'].map { |p| Runa::Product.new(p) })
27
45
  end
46
+ @after_key = @payload['pagination']['cursors']['after']
28
47
  else
29
48
  @all = []
30
49
  end
31
-
32
- self
33
50
  end
34
51
  end
data/lib/runa/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Runa
4
4
  # api-version.lib-build
5
- VERSION = '0.2.1'
5
+ VERSION = '0.3.1'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runa-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Oglesby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-09 00:00:00.000000000 Z
11
+ date: 2024-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday