shoptet 0.0.53 → 0.0.54

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/shoptet.rb +3 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42b4c432df5a8cfab2fd74136176b36850144aac3a4d58b218b35ed0991b5d9d
4
- data.tar.gz: b3de00e1daa9c3559092ee0245e646bf6023de7a1b09e4cf42834949f578a41f
3
+ metadata.gz: 0d1540eac2f1805254cc70fd81b16e333368bfa2b14344361e9531e4890637d0
4
+ data.tar.gz: 0200d1d0258da7d2014bb49e4b8092eb85f006ac0bbb52898ddff77269f62e57
5
5
  SHA512:
6
- metadata.gz: 842b328f703ac1b57597933aa98609fcae19343ae1572889f68e15c6b8438e4a904a7176ed88c65aa4934f331672addf19150e4ee12dd2ce118771ec3c9811d0
7
- data.tar.gz: 5030c94e9b3a8487bcdbc07c1fc62e06e8cd1b6fd3a764e5b40269556de93f4a50bf6ace829f3cdec849da3084073def60f40d172e8f90c466863ae7857ac8fc
6
+ metadata.gz: 570517fe21155f6fd7d28d701885acb996e2842b46a603f03c6f92d011f34d5037bc90d8347e12ce844b5ada429733762a532d38fa93c548167ca83c96d427ce
7
+ data.tar.gz: 44a5b9002f63a7518c3a3964f62585734dceaff60e3c3ce2b144997825995c3eadec69a21049432770666b41c1a9412b3685e4d802221b3694eefcaafd7859ac
data/lib/shoptet.rb CHANGED
@@ -29,7 +29,7 @@ class Shoptet
29
29
  end
30
30
 
31
31
  def self.version
32
- '0.0.53'
32
+ '0.0.54'
33
33
  end
34
34
 
35
35
  def self.ar_on_token_error(model)
@@ -81,13 +81,13 @@ class Shoptet
81
81
 
82
82
  attr_accessor :api_token
83
83
 
84
- def initialize oauth_url:, oauth_token:, shop_url:, client_id:, api_token: nil, on_token_error: nil
84
+ def initialize(oauth_url:, oauth_token:, shop_url:, client_id:, api_token: nil, on_token_error: nil)
85
85
  @oauth_url = oauth_url
86
86
  @oauth_token = oauth_token
87
87
  @shop_url = shop_url
88
88
  @client_id = client_id
89
- @api_token = api_token
90
89
  @on_token_error = on_token_error || ON_TOKEN_ERROR
90
+ @api_token = api_token || @on_token_error.call(self)
91
91
  end
92
92
 
93
93
  def endpoints api_params = {}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoptet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.53
4
+ version: 0.0.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - Premysl Donat
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-06 00:00:00.000000000 Z
11
+ date: 2023-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: irb