parameter_normalizer 0.2.0 → 0.3.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: ed6daec021aaea738b093569582d220ca208c37750b03d819554885dca34876e
4
- data.tar.gz: 1411c6eebb922adcac2cd7406c2a36b69b0f222cc50defd17fbe94dd1b0532c9
3
+ metadata.gz: 58d4d06affca59a94ff2f62dc948c1b130869407246fdbb6561534ac349e8e7f
4
+ data.tar.gz: 892359b6a2b76b655217f6e1a7b491fab1993d7a9a1b84b50bc6b66eeda635fb
5
5
  SHA512:
6
- metadata.gz: 051fb3063c3c2002ac1f402e06ab281816f7c6a3b4daea4232a4d1b5bb00cc5b675ecb3b6a817bd8372dcb0a9d2cc1df2ea44c553b8bbb1e7d7d842655c57ea0
7
- data.tar.gz: 608b0e876cdbb4fb21c5a239d2495372ed85d70440d335c002e4b6bccc341bd89ddebb8e0d2caf2a5d88bf26d5adc00c9ca702574e3428bf485ce00d44a4150f
6
+ metadata.gz: 3a54177aa28fd77f9cec3a5aa4ca1f3edeb06afb31ae2a605dadc273c69e51f44849f0be0890aed3fa083e41bbc343266100699537f37067713d5b64d15f6970
7
+ data.tar.gz: afbc832b80a5612d503dcdb04b615832fe9ed984cd33fcadb8248ea02df3cb0556ab4cd796ad285cfbb2c2dc10e350ffd3db3e7d3185aa91b6d170fc5fbde530
@@ -6,6 +6,14 @@ module ParameterNormalizer
6
6
  def parameter_normalizer
7
7
  @parameter_normalizer ||= ParameterNormalizer::Normalizer.new
8
8
  end
9
+
10
+ def normalize_parameter(key, method, skip_key_not_found: true)
11
+ if skip_key_not_found
12
+ return unless params.key?(key)
13
+ end
14
+
15
+ params[key] = parameter_normalizer.public_send(method, params[key])
16
+ end
9
17
  end
10
18
  end
11
19
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ParameterNormalizer
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parameter_normalizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takahiro Ooishi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-11 00:00:00.000000000 Z
11
+ date: 2024-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties