hash_wia 0.8.7 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.version +1 -1
- data/lib/hash_wia/module.rb +14 -2
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0193d39da72201f6f4e995bae56c2e01f51db23a9a4cbd6113b4c014fd5cfef3'
|
|
4
|
+
data.tar.gz: 9e241c6b2ab16bfad6e6665ca34431e19fdc0595169677dd7dd3ad19695602aa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a2c166a225960e23fb8b3e39ba10512ff9ba7eadf72ed485ecfe2e325ee10c2365825a887dbdb7ce65818700d09cdc5094f59c94dfd36428c994094898c9769f
|
|
7
|
+
data.tar.gz: 3cb2eb4aa569a9eebbc1a0098230e7e3634a381a7fb09a2fae1748ab1d0c920e94b085d7c823702485e6d2a5c8fcfa3b72b1acb32621226a56e771631d31662f
|
data/.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.9.0
|
data/lib/hash_wia/module.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module HashWiaModule
|
|
2
|
-
def initialize hash=nil
|
|
2
|
+
def initialize hash = nil
|
|
3
3
|
if hash
|
|
4
4
|
hash.each { |k,v| self[k] = v }
|
|
5
5
|
end
|
|
@@ -82,6 +82,12 @@ module HashWiaModule
|
|
|
82
82
|
root
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
+
def values
|
|
86
|
+
super.map do |el|
|
|
87
|
+
el.class == Hash ? HashWia.new(el) : el
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
85
91
|
def method_missing name, *args, &block
|
|
86
92
|
strname = name.to_s
|
|
87
93
|
|
|
@@ -106,7 +112,13 @@ module HashWiaModule
|
|
|
106
112
|
end
|
|
107
113
|
end
|
|
108
114
|
else
|
|
109
|
-
value
|
|
115
|
+
case value
|
|
116
|
+
when Array
|
|
117
|
+
# if we return list oh hashes, convert it to hwia
|
|
118
|
+
value.map {|el| el.class == Hash ? HashWia.new(el) : el }
|
|
119
|
+
else
|
|
120
|
+
value
|
|
121
|
+
end
|
|
110
122
|
end
|
|
111
123
|
end
|
|
112
124
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hash_wia
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dino Reic
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 2025-02-21 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
12
|
description: Gem provides simple access to common Ruby hash types bundled in one simple
|
|
14
13
|
class
|
|
@@ -26,7 +25,6 @@ homepage: https://github.com/dux/hash_wia
|
|
|
26
25
|
licenses:
|
|
27
26
|
- MIT
|
|
28
27
|
metadata: {}
|
|
29
|
-
post_install_message:
|
|
30
28
|
rdoc_options: []
|
|
31
29
|
require_paths:
|
|
32
30
|
- lib
|
|
@@ -41,8 +39,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
41
39
|
- !ruby/object:Gem::Version
|
|
42
40
|
version: '0'
|
|
43
41
|
requirements: []
|
|
44
|
-
rubygems_version: 3.4
|
|
45
|
-
signing_key:
|
|
42
|
+
rubygems_version: 3.6.4
|
|
46
43
|
specification_version: 4
|
|
47
44
|
summary: Hash with indifferent access + goodies
|
|
48
45
|
test_files: []
|