hash_pick 0.2.2 → 1.0.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/lib/hash_pick.rb +3 -2
- data/lib/hash_pick/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fcaed2a9ad6d1d9344869b5667f90a6e79b4e317
|
|
4
|
+
data.tar.gz: cf63a3d670fcd6c6d9d1cc2ea087f714d8a5c4b1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cefc7db913c19240c233145c74006a6dec712721c60dee30dddffda89c5577b5154b07715daa9394cca8ea17d42c65dc8e0198d500a82a4585d067f7c614668f
|
|
7
|
+
data.tar.gz: d174c49cf7d27cb121fd7b2cf798ee29b37678b860f37e79e34c005c8eecd01446bafe84dba3698f49eeeacdb852b5b876ebb1124b5547066e62f9e467ed249d
|
data/lib/hash_pick.rb
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
##
|
|
4
4
|
# Fetch a value from a nested dictionary
|
|
5
5
|
#
|
|
6
|
-
# Provides methods for fetching a value from a nested dictionary
|
|
6
|
+
# Provides methods for fetching a value from a nested dictionary
|
|
7
|
+
# (an object structure whose root and branch nodes are +Enumerable+ and implement +[]+),
|
|
7
8
|
# using a key path expressed as a list (an +Enumerable+ object whose +each+ method yields a path key).
|
|
8
9
|
#
|
|
9
10
|
# The key path is iterated. In each iteration, the key is looked up in the dictionary, and the value found is used
|
|
@@ -120,7 +121,7 @@ module HashPick
|
|
|
120
121
|
end
|
|
121
122
|
|
|
122
123
|
def dictionary?(hash)
|
|
123
|
-
hash.respond_to?(:[])
|
|
124
|
+
hash.is_a?(Enumerable) and hash.respond_to?(:[])
|
|
124
125
|
end
|
|
125
126
|
|
|
126
127
|
def assert_non_nil_path_keys(path)
|
data/lib/hash_pick/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hash_pick
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sheldon Hearn
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-02-
|
|
11
|
+
date: 2017-02-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|