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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7dd8624c8171843a2eef1aff8cc3a36703a73ed8
4
- data.tar.gz: 3e7e026f72fdbcf650ba94a1297250ae5400698a
3
+ metadata.gz: fcaed2a9ad6d1d9344869b5667f90a6e79b4e317
4
+ data.tar.gz: cf63a3d670fcd6c6d9d1cc2ea087f714d8a5c4b1
5
5
  SHA512:
6
- metadata.gz: '08237ef3fe7264baffb72f88d34645f50edd0864ac39aa7672d84740b2bfd167bce45447efe93bc4590784095a525296199d66f2079b9b884c8dcae691fd24e2'
7
- data.tar.gz: 975e6f37633a6da46bd54ef97db4c3b390e2697d981421834576da98f6ae0a96d89e997fff8f9a93f84f164be811cd6b4a004a05fc6a31f6bda1ea21d1294c5a
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 (an object structure whose root and branch nodes implement +[]+),
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)
@@ -1,3 +1,3 @@
1
1
  module HashPick
2
- VERSION = "0.2.2"
2
+ VERSION = "1.0.0"
3
3
  end
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.2.2
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-15 00:00:00.000000000 Z
11
+ date: 2017-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler