hermes_api 0.3.0 → 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: 2b1313c32c78bfdd9fb7a8256298157ca5a13f8a92a5074edeb1671969cb5f43
4
- data.tar.gz: 14a9dbfd88d46e2c0dce1e49baf0fd8d992332ac5051a60e24b7dc9af083c9a4
3
+ metadata.gz: d101377a4a226bc69ba37a0d644c196f23c35536812fda7bef716682dc01de05
4
+ data.tar.gz: 022f6ac19dfc202bad3df1a1d4b99753c49979dc35161893be38e17fe40bde5c
5
5
  SHA512:
6
- metadata.gz: 8bab7f7db1681634318f832ce9e2aacd1d059025f2745dfddc6a115581dfaad5de7baa552ceb23116e31fa3dae7cbdc16f9200ddad8ad61b7a828156a3fd925b
7
- data.tar.gz: 31f1ea2846b709e074a7a280b8ee7fa84820db2622370c2b011fe53d69d1bcd3ff536b921a8aaa20bfe2a6aad66d3098d1f81bea283866b74e9d5eb555e3cdff
6
+ metadata.gz: c08cfed50575d2a1e68d79d0dc06e51537aefe570c2af67c5eb04dacb189a71d374698a4f62c89d3dd4190b94890c1bd2fd83050dcd05e0160a66f4a470f4a92
7
+ data.tar.gz: 6b7c038decbcc7b330f5f666bd997bfe11d7e5d52a589c4068f98c490d8c27157f7767e1780ae29a0b8668f9a2fd47bf2a1d6b222762ad3b9b69ad7bbe8aeacb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hermes_api (0.2.1)
4
+ hermes_api (0.3.0)
5
5
  activeresource (>= 4.1.0, < 6.0.0)
6
6
 
7
7
  GEM
@@ -49,11 +49,15 @@ GEM
49
49
  rspec (>= 2.99.0, < 4.0)
50
50
  i18n (1.8.10)
51
51
  concurrent-ruby (~> 1.0)
52
+ image_processing (1.12.1)
53
+ mini_magick (>= 4.9.5, < 5)
54
+ ruby-vips (>= 2.0.17, < 3)
52
55
  listen (3.5.1)
53
56
  rb-fsevent (~> 0.10, >= 0.10.3)
54
57
  rb-inotify (~> 0.9, >= 0.9.10)
55
58
  lumberjack (1.2.8)
56
59
  method_source (1.0.0)
60
+ mini_magick (4.11.0)
57
61
  minitest (5.14.4)
58
62
  nenv (0.3.0)
59
63
  notiffany (0.1.3)
@@ -62,6 +66,10 @@ GEM
62
66
  parallel (1.20.1)
63
67
  parser (3.0.1.1)
64
68
  ast (~> 2.4.1)
69
+ pdf-core (0.9.0)
70
+ prawn (2.4.0)
71
+ pdf-core (~> 0.9.0)
72
+ ttfunk (~> 1.7)
65
73
  pry (0.14.1)
66
74
  coderay (~> 1.1)
67
75
  method_source (~> 1.0)
@@ -103,11 +111,14 @@ GEM
103
111
  rubocop (>= 1.7.0, < 2.0)
104
112
  rubocop-ast (>= 0.4.0)
105
113
  ruby-progressbar (1.11.0)
114
+ ruby-vips (2.1.2)
115
+ ffi (~> 1.12)
106
116
  shellany (0.0.1)
107
117
  standard (1.1.3)
108
118
  rubocop (= 1.18.1)
109
119
  rubocop-performance (= 1.11.2)
110
120
  thor (1.1.0)
121
+ ttfunk (1.7.0)
111
122
  tzinfo (2.0.4)
112
123
  concurrent-ruby (~> 1.0)
113
124
  unicode-display_width (2.0.0)
@@ -121,6 +132,8 @@ DEPENDENCIES
121
132
  gem-release
122
133
  guard-rspec
123
134
  hermes_api!
135
+ image_processing
136
+ prawn
124
137
  pry
125
138
  pry-byebug
126
139
  rake (~> 13.0)
data/bin/console CHANGED
@@ -6,7 +6,6 @@ require "dotenv/load"
6
6
  require "dev/zeitwerk_loader"
7
7
  require "dev/config"
8
8
  require "hermes_api"
9
-
10
9
  # You can add fixtures and/or initialization code here to make experimenting
11
10
  # with your gem easier. You can also use a different console, if you like.
12
11
  set_config
data/lib/hermes_api.rb CHANGED
@@ -14,6 +14,6 @@ module HermesAPI
14
14
 
15
15
  require "hermes_api/resources/o_auth"
16
16
  require "hermes_api/resources/json_base"
17
- require "hermes_api/resources/print_in_store_qr"
17
+ require "hermes_api/resources/print_in_store_qr_code"
18
18
 
19
19
  end
@@ -1,5 +1,5 @@
1
1
  module HermesAPI
2
- class PrintInStoreQr < JsonBase
2
+ class PrintInStoreQrCode < JsonBase
3
3
  self.element_name = ""
4
4
  self.prefix = "/client-print-in-store-api/v1/references"
5
5
 
@@ -10,5 +10,10 @@ module HermesAPI
10
10
  attributes = attributes[0] if attributes.is_a?(Array) && attributes.length == 1
11
11
  super
12
12
  end
13
+
14
+ def qr_code
15
+ base64_data = as_json.dig("qrCode", "base64EncodedBytes")
16
+ Base64.decode64(base64_data) if base64_data
17
+ end
13
18
  end
14
19
  end
@@ -87,7 +87,7 @@ module HermesAPI
87
87
  customer = collectionRoutingRequestEntries[0].customer
88
88
  address = customer.address
89
89
 
90
- self.print_in_store_qr_code = PrintInStoreQr.create(
90
+ self.print_in_store_qr_code = PrintInStoreQrCode.create(
91
91
  customer: {
92
92
  customerReference1: customer.customerReference1
93
93
  },
@@ -120,9 +120,5 @@ module HermesAPI
120
120
  **attrs
121
121
  )
122
122
  end
123
-
124
- def base64_print_in_store_qr_code
125
- as_json.dig("print_in_store_qr_code", "qrCode", "base64EncodedBytes")
126
- end
127
123
  end
128
124
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HermesAPI
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hermes_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Chong
@@ -158,7 +158,7 @@ files:
158
158
  - lib/hermes_api/resources/base.rb
159
159
  - lib/hermes_api/resources/json_base.rb
160
160
  - lib/hermes_api/resources/o_auth.rb
161
- - lib/hermes_api/resources/print_in_store_qr.rb
161
+ - lib/hermes_api/resources/print_in_store_qr_code.rb
162
162
  - lib/hermes_api/resources/return_label.rb
163
163
  - lib/hermes_api/version.rb
164
164
  homepage: https://github.com/PostCo/hermes_api