kim 0.0.3 → 0.0.4

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.
Files changed (5) hide show
  1. data/README +4 -0
  2. data/README.md +4 -0
  3. data/lib/kim/hash.rb +4 -0
  4. data/lib/kim/version.rb +1 -1
  5. metadata +3 -3
data/README CHANGED
@@ -13,3 +13,7 @@ When merging Hashes it will take care of merging nested hashes
13
13
  ### deep_has_key?
14
14
 
15
15
  Provide multiple keys and it will tell you if they are contained in the current hash, taking nesting into account
16
+
17
+ ### deep_value
18
+
19
+ Finds a value taking nesting into account
data/README.md CHANGED
@@ -13,3 +13,7 @@ When merging Hashes it will take care of merging nested hashes
13
13
  ### deep_has_key?
14
14
 
15
15
  Provide multiple keys and it will tell you if they are contained in the current hash, taking nesting into account
16
+
17
+ ### deep_value
18
+
19
+ Finds a value taking nesting into account
data/lib/kim/hash.rb CHANGED
@@ -20,6 +20,10 @@ module Kim
20
20
  def deep_has_key? *keys
21
21
  has_key?(key = keys.shift) && ( keys.count < 1 || self[key].deep_has_key?(*keys))
22
22
  end
23
+
24
+ def deep_value *keys
25
+ keys.count <= 1 ? self[keys.first] : self[keys.shift].deep_val(*keys)
26
+ end
23
27
  end
24
28
  end
25
29
 
data/lib/kim/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kim
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kim
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Giancarlo Palavicini