jsof 0.1.0 → 0.2.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: c83f6ee1b4cb426245690720ddfe8d25cc64a80bdb432a37e4dea766a9d066c8
4
- data.tar.gz: e55a4b4a98f039ff9c864318a72649be3ff363add77e46d693b3e648da1ee85a
3
+ metadata.gz: 16b2b1eca2132ec71666bc2829f2b7cfd5581f3c78b3e953510a6779bce577bc
4
+ data.tar.gz: b46bf4cddbfda267939d815b236d3e6dc72af172764b90f53568cf3101898aa4
5
5
  SHA512:
6
- metadata.gz: 4285733477cc69de5f682d26c21f3069946341eece8eb826ea67fc69985bcba42cd87f4c0b0c53a1e476bbe6c9d437c07f58bf310f41a1499225841209f88a6e
7
- data.tar.gz: 874d2e9d7ecf1dd735f0398a679477f4aae5b4530b9624e49adbbb8d9b7dfbfc80d0665b5040cf356c21c546f8b53919288dde528a8c3de6fc4047385ce5a7be
6
+ metadata.gz: 3868a8bdffe224d6d6605f845effee808c460efe125412f0a46b6b8677b54088a8912bfc72e9824577efab74d78b6fe0fdfc199fd6c9bc591f08404e62ba1fe0
7
+ data.tar.gz: c559534816102c21b7fc7b5b2b8d4d9091cf26615f9626ce8d5f172be5cb4aec1d29b4781bb03ac0ea90c42b92ca8d0a44f682300b163400ba61f9cd3a4d34e2
data/lib/jsof/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jsof
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -89,7 +89,12 @@ class Jsof::WrapObject
89
89
  sym = key.to_sym
90
90
  return @wrapped[sym] if @wrapped.key?(sym)
91
91
 
92
- elem = @internal_object[sym]
92
+ elem = nil
93
+ if @internal_object.key? sym
94
+ elem = @internal_object[sym]
95
+ elsif @internal_object.key? key.to_s
96
+ elem = @internal_object[key.to_s]
97
+ end
93
98
  boxed = Jsof::WrapHelper.boxing(elem, self.class.typeof_properties[sym])
94
99
  @wrapped[sym] = boxed if elem != boxed
95
100
  return boxed
@@ -102,8 +107,14 @@ class Jsof::WrapObject
102
107
  end
103
108
  boxed = Jsof::WrapHelper.boxing(val, self.class.typeof_properties[sym])
104
109
  @wrapped[sym] = boxed if Jsof::WrapHelper.wrapped_value?(boxed)
105
- @internal_object[sym] = Jsof::WrapHelper.unboxing(val)
106
- val
110
+
111
+ internal_key = sym
112
+ if @internal_object.key? sym
113
+ # use symbol (check first to avoid unnecessary to_s)
114
+ elsif @internal_object.key? sym.to_s
115
+ internal_key = sym.to_s
116
+ end
117
+ @internal_object[internal_key] = Jsof::WrapHelper.unboxing(val)
107
118
  end
108
119
 
109
120
  # Clean internal cache.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Riki Ishikawa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-19 00:00:00.000000000 Z
11
+ date: 2022-01-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: