apiverve_unitconverter 1.2.4 → 1.2.5

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: c37a24158838247095448d1ca4730e7e50ba07e05f76d56af1353ab66805259c
4
- data.tar.gz: 1e09853db1bd0fbde04d799a0e2475ddf0edbb83eeb7bb4d5ff262f7c83f39f1
3
+ metadata.gz: b89737455e5cdb599b5bafb80afed76cd8393b7991b174ec6e99a6f28003c496
4
+ data.tar.gz: 75410d15dd51bc29f6914837487f1731a6e3b715d0f013cd38cfbf5f3c50a283
5
5
  SHA512:
6
- metadata.gz: f27b8f5210298a48f4e8812d1a76c7363e721e24f5a46db283382f71730b27aacc1ebb5fe9baf6e26512bbc82d45ed22ca95ffd3a9e7a6073dbec8ed05ff1324
7
- data.tar.gz: 7c9618f6fddb5bd17f223a1a378908ade89c57a13b5e250830a0fb978bd3d99c09b9745f93b9c632ed0b4551ca17c488bae08cf252a40af8b8abb39e57aa3a6f
6
+ metadata.gz: 978c44fb30a7aa0aa3fbe6739d6bd244edff4bc298b0a5f82a3f35bee1b149461aa36737f75d80300d28e1a066e2fdc8c46e205833294721b66d41aa0f0c1e5c
7
+ data.tar.gz: 554403f6b78f7ae2c9e64f8c233eae9031a9ef031c14ae546c16fb5348a85472f0cebb3c8c5ed6212c6e025f395889166db8ab207e2e67632c87ed3897c39f8c
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Unit Converter API - Ruby Gem
2
2
 
3
- Unit Converter converts values between different units of measurement. Pass a numeric value with source and target unit identifiers to get the converted result and unit abbreviations.
3
+ Unit Converter converts values between 185 units across 23 measures, from length, mass and volume to speed, pressure, data size, energy and electrical units. Pass a numeric value with source and target unit codes to get the converted result and unit abbreviations. On paid plans, precision sets the decimal places and conversions=true adds the value in every unit of the same measure.
4
4
 
5
5
  ## Installation
6
6
 
@@ -38,7 +38,9 @@ client = APIVerve::Unitconverter::Client.new(api_key: "YOUR_API_KEY")
38
38
  response = client.execute({
39
39
  value: 100,
40
40
  from: "lb",
41
- to: "kg"
41
+ to: "kg",
42
+ precision: 2,
43
+ conversions: true
42
44
  })
43
45
 
44
46
  # Print the response
@@ -50,7 +52,7 @@ puts response
50
52
 
51
53
  ```ruby
52
54
  begin
53
- response = client.execute({ value: 100, from: "lb", to: "kg" })
55
+ response = client.execute({ value: 100, from: "lb", to: "kg", precision: 2, conversions: true })
54
56
  puts response["data"]
55
57
  rescue APIVerve::Unitconverter::ValidationError => e
56
58
  puts "Validation error: #{e.errors.join(', ')}"
@@ -97,6 +99,16 @@ client = APIVerve::Unitconverter::Client.new(
97
99
  "singular": "Kilogram",
98
100
  "plural": "Kilograms"
99
101
  }
102
+ },
103
+ "conversions": {
104
+ "mcg": 45359200000,
105
+ "mg": 45359200,
106
+ "g": 45359.2,
107
+ "kg": 45.36,
108
+ "mt": 0.05,
109
+ "oz": 1600,
110
+ "lb": 100,
111
+ "t": 0.05
100
112
  }
101
113
  }
102
114
  }
@@ -10,7 +10,7 @@ module APIVerve
10
10
  #
11
11
  # @example Basic usage
12
12
  # client = APIVerve::Unitconverter::Client.new(api_key: "your_api_key")
13
- # response = client.execute({ value: 100, from: "lb", to: "kg" })
13
+ # response = client.execute({ value: 100, from: "lb", to: "kg", precision: 2, conversions: true })
14
14
  # puts response
15
15
  #
16
16
  # @see https://apiverve.com/marketplace/unitconverter?utm_source=ruby&utm_medium=referral&utm_content=readme
@@ -19,7 +19,7 @@ module APIVerve
19
19
  DEFAULT_TIMEOUT = 30
20
20
 
21
21
  # Validation rules for parameters
22
- VALIDATION_RULES = { 'value' => { type: 'number', required: true }, 'from' => { type: 'string', required: true }, 'to' => { type: 'string', required: true } }
22
+ VALIDATION_RULES = { 'value' => { type: 'number', required: true }, 'from' => { type: 'string', required: true }, 'to' => { type: 'string', required: true }, 'precision' => { type: 'integer', required: false, min: 0, max: 10 }, 'conversions' => { type: 'boolean', required: false } }
23
23
 
24
24
  # Format validation patterns
25
25
  FORMAT_PATTERNS = {
@@ -4,6 +4,6 @@ require_relative "apiverve_unitconverter/client"
4
4
 
5
5
  module APIVerve
6
6
  module Unitconverter
7
- VERSION = "1.2.4"
7
+ VERSION = "1.2.5"
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apiverve_unitconverter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - APIVerve
@@ -57,9 +57,11 @@ dependencies:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
59
  version: '2.0'
60
- description: Unit Converter converts values between different units of measurement.
61
- Pass a numeric value with source and target unit identifiers to get the converted
62
- result and unit abbreviations.
60
+ description: Unit Converter converts values between 185 units across 23 measures,
61
+ from length, mass and volume to speed, pressure, data size, energy and electrical
62
+ units. Pass a numeric value with source and target unit codes to get the converted
63
+ result and unit abbreviations. On paid plans, precision sets the decimal places
64
+ and conversions=true adds the value in every unit of the same measure.
63
65
  email:
64
66
  - hello@apiverve.com
65
67
  executables: []