lucid_shopify 0.27.1 → 0.28.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lucid_shopify/response.rb +4 -4
- data/lib/lucid_shopify/version.rb +1 -1
- data/lib/lucid_shopify/webhook.rb +34 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10054d2fb445e9c404820b50cb5f98b838d0431bf977ff4aaf8cd2e45fd52315
|
4
|
+
data.tar.gz: 13a4ca4660f85f79d6614c9fd2fdc406381a5a97391ad55e8d6eb3bdc9e868e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a6c6ded622ad8210f1d8652c5ffaa4b39fb49bd11109b8051452c815b1e2bd5480e5bc234ba43903f260d377842b7cd58310ccec3d7c85918605b1e67617f3e
|
7
|
+
data.tar.gz: b79e3439b6261556d1c6346523230a5cd9748a7389e53322b56dc8dc818284a4ebd0cc64f67dc5376b3cfd51c0695f88891800353664577310e8b4e57a438cd4
|
@@ -40,16 +40,16 @@ module LucidShopify
|
|
40
40
|
param :headers
|
41
41
|
# @return [String]
|
42
42
|
param :data
|
43
|
-
# @return [Hash] the parsed response body
|
44
|
-
param :data_hash, default: -> { parse_data }
|
45
43
|
|
44
|
+
#
|
45
|
+
# The parsed response body.
|
46
46
|
#
|
47
47
|
# @return [Hash]
|
48
48
|
#
|
49
|
-
private def
|
49
|
+
private def data_hash
|
50
50
|
return {} unless json?
|
51
51
|
|
52
|
-
JSON.parse(data)
|
52
|
+
@data_hash ||= JSON.parse(data)
|
53
53
|
end
|
54
54
|
|
55
55
|
#
|
@@ -14,16 +14,46 @@ module LucidShopify
|
|
14
14
|
param :topic
|
15
15
|
# @return [String]
|
16
16
|
param :data
|
17
|
-
# @return [Hash] the parsed request body
|
18
|
-
param :data_hash, default: -> { parse_data }
|
19
17
|
|
20
18
|
#
|
21
19
|
# @return [Hash]
|
22
20
|
#
|
23
|
-
|
24
|
-
JSON.parse(data)
|
21
|
+
def data_hash
|
22
|
+
@data_hash ||= JSON.parse(data)
|
25
23
|
rescue JSON::ParserError
|
26
24
|
{}
|
27
25
|
end
|
26
|
+
|
27
|
+
#
|
28
|
+
# @see Hash#each
|
29
|
+
#
|
30
|
+
def each(&block)
|
31
|
+
data_hash.each(&block)
|
32
|
+
end
|
33
|
+
|
34
|
+
#
|
35
|
+
# @param key [String]
|
36
|
+
#
|
37
|
+
# @return [Object]
|
38
|
+
#
|
39
|
+
def [](key)
|
40
|
+
data_hash[key]
|
41
|
+
end
|
42
|
+
|
43
|
+
alias_method :to_h, :data_hash
|
44
|
+
|
45
|
+
#
|
46
|
+
# @return [Hash]
|
47
|
+
#
|
48
|
+
def as_json(*)
|
49
|
+
to_h
|
50
|
+
end
|
51
|
+
|
52
|
+
#
|
53
|
+
# @return [String]
|
54
|
+
#
|
55
|
+
def to_json(*args)
|
56
|
+
as_json.to_json(*args)
|
57
|
+
end
|
28
58
|
end
|
29
59
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucid_shopify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelsey Judson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|