camel_snake_struct 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/camel_snake_struct.gemspec +1 -1
- data/lib/camel_snake_struct.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 810f5a99f464439e0e6ebeebad3df0dbfb41bcd868a8d0418cfe60b6df7c9b8e
|
4
|
+
data.tar.gz: a8e071224633a912dc8ca9f32ee2aaeb03b2e5f0c1bd63b7a1f910d38d53e0d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e272d3ebeb81fa42f0a61c6f31e398d41f16a1fb6a946c2091cd469dae8f2f171cc5ca02b2185c2fc24504fe723218eec4f83f942c863ff8d1f48e00878c6aaa
|
7
|
+
data.tar.gz: 49d5154129c2a0497e549b50b8caade8ab6533d329c8a7d2c5853d59f95d084511c7a58b3b02573c7582a5ffad7638aa9981c3edfc7ef00eb8f503981a4e1409
|
data/CHANGELOG.md
CHANGED
data/camel_snake_struct.gemspec
CHANGED
data/lib/camel_snake_struct.rb
CHANGED
@@ -45,7 +45,7 @@ class CamelSnakeStruct
|
|
45
45
|
def initialize(hash)
|
46
46
|
@_raw_hash = hash&.to_h || {}
|
47
47
|
@_method_to_key = @_raw_hash.keys.each_with_object({}) do |key, mapping|
|
48
|
-
if key =~ /^[A-Za-z]/
|
48
|
+
if key.gsub('@', '') =~ /^[A-Za-z]/
|
49
49
|
normalize_key = key.gsub('@', '').gsub(/\.|\s/, '_')
|
50
50
|
mapping[normalize_key] = key
|
51
51
|
mapping[normalize_key.underscore] = key
|