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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f4978b18cb18f1bd33284ad21a540552ef8a558fcdcff4fb0296c0f2d1c444f
4
- data.tar.gz: a830f31ca20fcff51e85832afa26e5cfa6c02d0a52d080427223c6e3bdd16342
3
+ metadata.gz: 810f5a99f464439e0e6ebeebad3df0dbfb41bcd868a8d0418cfe60b6df7c9b8e
4
+ data.tar.gz: a8e071224633a912dc8ca9f32ee2aaeb03b2e5f0c1bd63b7a1f910d38d53e0d5
5
5
  SHA512:
6
- metadata.gz: 309e7c1c9df867de7930257defd3588433f12248bc43e448f38c8132d66b20d34ebeb41ea58b9198414ed81769467853e98ddec1ed90319c3ea16d31db1cc2a3
7
- data.tar.gz: aa718371a22f920b35ad630f344d4bae3ed07081bd8a85771bf37c3b059f541985ea646d375c2df7a2e7bc0c1f9781602cbdaf99421c09dff3c92c9994c3fa62
6
+ metadata.gz: e272d3ebeb81fa42f0a61c6f31e398d41f16a1fb6a946c2091cd469dae8f2f171cc5ca02b2185c2fc24504fe723218eec4f83f942c863ff8d1f48e00878c6aaa
7
+ data.tar.gz: 49d5154129c2a0497e549b50b8caade8ab6533d329c8a7d2c5853d59f95d084511c7a58b3b02573c7582a5ffad7638aa9981c3edfc7ef00eb8f503981a4e1409
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.3.2
2
+ * fix handling of "@" in keys
3
+
1
4
  # 0.3.1
2
5
  * handle situation where the key of the hash will not make a valid method, EG { "2020-01-02 19:00:00 UTC" => [""] }
3
6
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "camel_snake_struct"
3
- spec.version = "0.3.1"
3
+ spec.version = "0.3.2"
4
4
  spec.authors = ["Grant Petersen-Speelman"]
5
5
  spec.email = ["grant@nexl.io"]
6
6
 
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: camel_snake_struct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Petersen-Speelman