tiny_dot 3.2.0 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tiny_dot.rb +8 -6
- 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: 74a6ef972dfb25d711771dfb752331bfe4ebab110752229e314cde74bd22b758
|
4
|
+
data.tar.gz: a03b2e4df7393f4b5afb3fc656e1772a1b22bcd476fe9dea9af3b41543901202
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74b643f6bb6382e2ea319817e75036c2a0b68f4fe719594e13d5f770d505a2ea1ddec944ed32da155cdf51d6ecd2a37bd56061b044e8347667fb976fc9c62b02
|
7
|
+
data.tar.gz: 1998eedd57db87400c39bdbf3b9d33a7b78dcd47db65ddc16533fa38de6b9c389e9279ffcc196116773baf8d5e56f6a75aae0346a304e9add95079655d06c9ca
|
data/lib/tiny_dot.rb
CHANGED
@@ -66,15 +66,17 @@ module TinyDot
|
|
66
66
|
_hash_to_struct(hash)
|
67
67
|
end
|
68
68
|
|
69
|
-
def _hash_to_struct(
|
70
|
-
case
|
69
|
+
def _hash_to_struct(obj)
|
70
|
+
case obj
|
71
71
|
when Hash
|
72
|
-
|
73
|
-
|
72
|
+
return obj if obj.keys.empty?
|
73
|
+
|
74
|
+
struct = ::Struct.new(*_to_attr_friendly_symbols(obj.keys))
|
75
|
+
struct.new(*obj.values.map { |v| _hash_to_struct(v) })
|
74
76
|
when Array
|
75
|
-
|
77
|
+
obj.map { |v| _hash_to_struct(v) }
|
76
78
|
else
|
77
|
-
|
79
|
+
obj
|
78
80
|
end
|
79
81
|
end
|
80
82
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiny_dot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Lunt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|