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 +4 -4
- data/lib/jsof/version.rb +1 -1
- data/lib/jsof/wrap_object.rb +14 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16b2b1eca2132ec71666bc2829f2b7cfd5581f3c78b3e953510a6779bce577bc
|
4
|
+
data.tar.gz: b46bf4cddbfda267939d815b236d3e6dc72af172764b90f53568cf3101898aa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3868a8bdffe224d6d6605f845effee808c460efe125412f0a46b6b8677b54088a8912bfc72e9824577efab74d78b6fe0fdfc199fd6c9bc591f08404e62ba1fe0
|
7
|
+
data.tar.gz: c559534816102c21b7fc7b5b2b8d4d9091cf26615f9626ce8d5f172be5cb4aec1d29b4781bb03ac0ea90c42b92ca8d0a44f682300b163400ba61f9cd3a4d34e2
|
data/lib/jsof/version.rb
CHANGED
data/lib/jsof/wrap_object.rb
CHANGED
@@ -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 =
|
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
|
-
|
106
|
-
|
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.
|
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-
|
11
|
+
date: 2022-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|