lucid_shopify 0.26.0 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5f7bc0a5a0d0b523e0f3da1711e91adb48a9a73b93b237e827916ef9ad97015
4
- data.tar.gz: 7718a0112ed5e024c26d0eccb34a98940a05043d7efa7b5e0038d02271ecf546
3
+ metadata.gz: af502c346fe73acee9ef214473ba7003a6198e4ff4522590c2bee940e9da95da
4
+ data.tar.gz: 122b20a7745c3665bdaaffe620e8f059725b46581b2ebe14580e41fa749bb4d4
5
5
  SHA512:
6
- metadata.gz: 499b7442f162e6fa9abc2c66709a9e1211e0b29c2ebc5ceca51017416c34b25f79a50ad8f8a2a7b8ff59de11055ea558168a1091c7480fffa19fcbb83be8ee15
7
- data.tar.gz: 006f11e9ca1d26a0f06cf7d44992de4fa1fe0294ca3c0e6db9a78f8cead0227d2d7219a4968e451c4543e22234e913f00addcd25d262f800c38b0432bd6b1316
6
+ metadata.gz: 2d7edd4b2079dbb08cf1c2fb6ff932c1c635d620a55d65dd11e5d1d8457a7373f1b8da33cce54c52b811fcba8992d44afd2738b708160cca378260a0a37853e9
7
+ data.tar.gz: 394f62834d4375cc9b3b9fd108b8841f8c44aca88b20a1a145b627a57e50304f80a385fb449f72c5445dfe68dea0bc947f815c2b672dcdfd0cff7bd692004a67
@@ -30,6 +30,8 @@ module LucidShopify
30
30
 
31
31
  extend Dry::Initializer
32
32
 
33
+ include Enumerable
34
+
33
35
  # @return [Request] the original request
34
36
  param :request
35
37
  # @return [Integer]
@@ -106,5 +108,37 @@ module LucidShopify
106
108
  return {'resource' => errors} if errors.is_a?(String)
107
109
  errors
108
110
  end
111
+
112
+ #
113
+ # @see Hash#each
114
+ #
115
+ def each(&block)
116
+ data_hash.each(&block)
117
+ end
118
+
119
+ #
120
+ # @param key [String]
121
+ #
122
+ # @return [Object]
123
+ #
124
+ def [](key)
125
+ data_hash[key]
126
+ end
127
+
128
+ alias_method :to_h, :data_hash
129
+
130
+ #
131
+ # @return [Hash]
132
+ #
133
+ def as_json(*)
134
+ to_h
135
+ end
136
+
137
+ #
138
+ # @return [String]
139
+ #
140
+ def to_json(*args)
141
+ as_json.to_json(*args)
142
+ end
109
143
  end
110
144
  end
@@ -44,7 +44,7 @@ module LucidShopify
44
44
 
45
45
  log_response(req, res)
46
46
 
47
- res.assert!.data_hash
47
+ res.assert!
48
48
  rescue HTTP::ConnectionError,
49
49
  HTTP::ResponseError,
50
50
  HTTP::TimeoutError => e
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucidShopify
4
- VERSION = '0.26.0'
4
+ VERSION = '0.27.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucid_shopify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0
4
+ version: 0.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelsey Judson