wegift-ruby-client 1.8.4 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/wegift/client.rb +6 -0
- data/lib/wegift/models/stock.rb +32 -0
- data/lib/wegift/version.rb +1 -1
- data/lib/wegift.rb +1 -0
- metadata +23 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bed3c1cbd45d744b02c6737ad4f55f49cbb71c28
|
4
|
+
data.tar.gz: ec366ffec07bc3905f63123bcd6272745a67699e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5a9b590644a45bff06e13a144ed9fffaf6ac296fa46e620a10e579a6fa676027cc542f0556db5210cdf46059f51759fdc9497a4ccea033a14d06922fc473933
|
7
|
+
data.tar.gz: 85e5ec40f0dbb637fbfe1dabad2262482583ebf52edc69496929ca5bb8dff4afd7a675e42d58e7b25b98d545c7b499b0da8df76f676ae2c767385f199e91441d
|
data/lib/wegift/client.rb
CHANGED
@@ -6,6 +6,7 @@ require_relative 'models/response'
|
|
6
6
|
require_relative 'models/product'
|
7
7
|
require_relative 'models/products'
|
8
8
|
require_relative 'models/order'
|
9
|
+
require_relative 'models/stock'
|
9
10
|
|
10
11
|
module Wegift
|
11
12
|
class Client
|
@@ -58,5 +59,10 @@ module Wegift
|
|
58
59
|
order = Wegift::Order.new(options)
|
59
60
|
order.post(self)
|
60
61
|
end
|
62
|
+
|
63
|
+
def stock(id)
|
64
|
+
stock = Wegift::Stock.new(product_code: id)
|
65
|
+
stock.get(self)
|
66
|
+
end
|
61
67
|
end
|
62
68
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Wegift::Stock < Wegift::Response
|
4
|
+
PATH = '/stock'
|
5
|
+
|
6
|
+
# request/payload
|
7
|
+
attr_accessor :product_code
|
8
|
+
|
9
|
+
# response/success
|
10
|
+
attr_accessor :available_stock, :currency_code, :product_code, :product_name
|
11
|
+
|
12
|
+
def initialize(params = {})
|
13
|
+
super
|
14
|
+
end
|
15
|
+
|
16
|
+
def path
|
17
|
+
[PATH, product_code.to_s].join('/')
|
18
|
+
end
|
19
|
+
|
20
|
+
# Product Stock
|
21
|
+
# GET /api/b2b-sync/v1/stock/ID
|
22
|
+
def get(ctx)
|
23
|
+
response = ctx.request(:get, path)
|
24
|
+
parse(response)
|
25
|
+
end
|
26
|
+
|
27
|
+
def parse(response)
|
28
|
+
super
|
29
|
+
|
30
|
+
self
|
31
|
+
end
|
32
|
+
end
|
data/lib/wegift/version.rb
CHANGED
data/lib/wegift.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wegift-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Klaas Endrikat
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -34,22 +34,22 @@ dependencies:
|
|
34
34
|
name: json
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - ">="
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: 2.3.0
|
40
37
|
- - "~>"
|
41
38
|
- !ruby/object:Gem::Version
|
42
39
|
version: '2.3'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 2.3.0
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - ">="
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: 2.3.0
|
50
47
|
- - "~>"
|
51
48
|
- !ruby/object:Gem::Version
|
52
49
|
version: '2.3'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 2.3.0
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: bundler
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,22 +82,22 @@ dependencies:
|
|
82
82
|
name: dotenv
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
|
-
- - ">="
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: 2.2.0
|
88
85
|
- - "~>"
|
89
86
|
- !ruby/object:Gem::Version
|
90
87
|
version: '2.2'
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 2.2.0
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- - ">="
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: 2.2.0
|
98
95
|
- - "~>"
|
99
96
|
- !ruby/object:Gem::Version
|
100
97
|
version: '2.2'
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: 2.2.0
|
101
101
|
- !ruby/object:Gem::Dependency
|
102
102
|
name: rake
|
103
103
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,22 +150,22 @@ dependencies:
|
|
150
150
|
name: webmock
|
151
151
|
requirement: !ruby/object:Gem::Requirement
|
152
152
|
requirements:
|
153
|
-
- - ">="
|
154
|
-
- !ruby/object:Gem::Version
|
155
|
-
version: 3.5.0
|
156
153
|
- - "~>"
|
157
154
|
- !ruby/object:Gem::Version
|
158
155
|
version: '3.5'
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: 3.5.0
|
159
159
|
type: :development
|
160
160
|
prerelease: false
|
161
161
|
version_requirements: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
|
-
- - ">="
|
164
|
-
- !ruby/object:Gem::Version
|
165
|
-
version: 3.5.0
|
166
163
|
- - "~>"
|
167
164
|
- !ruby/object:Gem::Version
|
168
165
|
version: '3.5'
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: 3.5.0
|
169
169
|
description:
|
170
170
|
email:
|
171
171
|
- klaas.endrikat@googlemail.com
|
@@ -192,6 +192,7 @@ files:
|
|
192
192
|
- lib/wegift/models/product.rb
|
193
193
|
- lib/wegift/models/products.rb
|
194
194
|
- lib/wegift/models/response.rb
|
195
|
+
- lib/wegift/models/stock.rb
|
195
196
|
- lib/wegift/version.rb
|
196
197
|
- wegift-ruby-client.gemspec
|
197
198
|
homepage: https://github.com/kendrikat/wegift-ruby-client
|
@@ -213,7 +214,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
214
|
- !ruby/object:Gem::Version
|
214
215
|
version: '0'
|
215
216
|
requirements: []
|
216
|
-
|
217
|
+
rubyforge_project:
|
218
|
+
rubygems_version: 2.5.2
|
217
219
|
signing_key:
|
218
220
|
specification_version: 4
|
219
221
|
summary: A simple Ruby client for the WEGIFT API
|