e_plat 0.4.3 → 0.4.4

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: ee797b0b23712947fd4ed9e566a4a26548b887fc7958254343eab9b97073e708
4
- data.tar.gz: d26e103052bf4fbf770890e5b05d0f49dcf4c6cd9ae4f473e3737640837fa148
3
+ metadata.gz: e1f621f479c0a566e9fafdc11e156345ad172ba623a3049b5f64fb67db915f04
4
+ data.tar.gz: 67b1a319ed52a56d5004c6cf5e164eafb602003db6c1855e2eb57e6e6ba3f8bb
5
5
  SHA512:
6
- metadata.gz: 213183bc25f835b78a18245f01cab417cd37625baf056e08a89500f492d3b019ee8691da997e33e60c8c4b7ea894eaf5120d7806b943fe001be3f888b58e74ce
7
- data.tar.gz: 464bb8e454266a48d6e157bd5e51f689216e59afc3bde7506a3ec3ae4ea1030bf4b0b3e3288b205ba88976885be76a1f6df2829dd93f5d7cae9d87ea977b8742
6
+ metadata.gz: e1fe8a237089d3528670cdc40f107e994a32f4bf10f3877af0758f7365a80a39bfe96e7f61c3fb464ed19b0f9a0e280e1c304f56e5e06c9ac5476577e02f18f1
7
+ data.tar.gz: 4964a6ab6ef2fcec16cefd24ed792db0e717f1baea0db72b3a8f687d9e1705fe6c9d89b6f07664395563a80f66dfc3660eb9fb6d7ec872fa2a494cb551f2aef5
data/README.md CHANGED
@@ -44,6 +44,9 @@ You can configure which platform APIs are used by updating the EPlat config: <br
44
44
  EPlat.config.shopify_api_version = "2024-01"
45
45
  EPlat.config.bigcommerce_api_version = "v3"
46
46
  EPlat.config.woocommerce_api_version = "v3"
47
+
48
+ # EPlat.api_display_name.shopify #=> "2024-01" # presents as the platform would display in URL paths
49
+ # EPlat.config.shopify_api_version #=> "2024_01" # coerced interally for creating constants
47
50
  ```
48
51
  <br>
49
52
 
@@ -1,3 +1,3 @@
1
1
  module EPlat
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
data/lib/e_plat.rb CHANGED
@@ -32,7 +32,16 @@ module EPlat
32
32
  SUPPORTED_BIGCOMMERCE_API_VERSIONS.include?(v) ? v : raise(ArgumentError, "Bigcommerce API version #{value} is not supported")
33
33
  end)
34
34
 
35
- setting(:woocommerce_api_version, default: "v3", constructor: ->(value) { value.downcase.gsub("v", "") })
35
+ setting(:woocommerce_api_version, default: "v3", constructor: ->(value) { value.downcase.gsub("v", "") })
36
+
37
+ def self.api_display_name
38
+ apis = Struct.new(:shopify, :bigcommerce, :woocommerce)
39
+ apis.new(
40
+ shopify: config.shopify_api_version&.dasherize, # "2024-01"
41
+ bigcommerce: "v#{config.bigcommerce_api_version}", # "v3"
42
+ woocommerce: "v#{config.woocommerce_api_version}" # "v3"
43
+ )
44
+ end
36
45
 
37
46
  class Error < StandardError; end
38
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: e_plat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - oliwoodsuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-08 00:00:00.000000000 Z
11
+ date: 2023-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler