hash_at_path 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4ebf82fa2947c9094ca412d96ed857e0ce99f1c
4
- data.tar.gz: 67fc78e7090622ab07d19d542b672759946171e6
3
+ metadata.gz: 2c04db7d7172f566e5ed0d5bea24adf87eaeb654
4
+ data.tar.gz: c64f2bb7e9c99fa06fb741ccc571e7894a919c78
5
5
  SHA512:
6
- metadata.gz: c28f3ff509053f219a31b37f781669a94113f556d47c1710e39b5a3003833b9583a28d6d3fcb1cd855de19637ddabec4aa45550d56aa04cfe8d5e290bed7a91d
7
- data.tar.gz: 1c6fd2a41b360c276d2d7fe89c6ce490e587bd296a864a5d6a9d609427c1c3208d969208e68970141322a790f1b6db000cc82efa4d5ee54f2681c5b2f118a7a2
6
+ metadata.gz: 0c904bb4cb986cf123053fca3225be136afe688d2b3373c3e8bcb480c6144c9296cd8ecc90227112b8801656d27dc96d39ffb042ae59aa8df089c18e83a6c2d4
7
+ data.tar.gz: 6476d9bd98105bf92f1db338e3c2ede76bf4c128ba0419c704d21e1a5f675a7576429d28f9fe87112a7bcf664ec969cbe700978719b8927c711f207ebb8a7169
@@ -20,16 +20,16 @@ module HashAtPath
20
20
  return nil if val.nil?
21
21
  predicate = path_parts[:predicate] unless predicate == '*'
22
22
  val, predicate = get_value_at_path(predicate, path_parts[:path], val)
23
- val = val[predicate.to_i] unless blank?(predicate) || predicate == '*' || !issa(val, 'Array')
23
+ val = val[predicate.to_i] unless is_blank?(predicate) || predicate == '*' || !issa(val, 'Array')
24
24
  end
25
25
  val
26
26
  end
27
27
 
28
28
  def get_value_at_path(predicate, path, val)
29
- if predicate == '*' && issa(val, 'Array') && !blank?(path)
29
+ if predicate == '*' && issa(val, 'Array') && !is_blank?(path)
30
30
  val = val.map {|item| unwind_path(item, path)}
31
31
  predicate = nil
32
- elsif !blank?(path) && issa(val, 'Hash')
32
+ elsif !is_blank?(path) && issa(val, 'Hash')
33
33
  val = unwind_path(val, path)
34
34
  end
35
35
  [val, predicate]
@@ -49,7 +49,7 @@ module HashAtPath
49
49
  end
50
50
 
51
51
  # Stolen from activesupport/lib/active_support/core_ext/object/blank.rb
52
- def blank?(object)
52
+ def is_blank?(object)
53
53
  object.respond_to?(:empty?) ? !!object.empty? : !object
54
54
  end
55
55
  end
@@ -1,3 +1,3 @@
1
1
  module HashAtPath
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash_at_path
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - chadfennell