hash_kit 0.4.6 → 0.4.7

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: 1fd60f2571506f72e4f1b3a9370d140535d08fe9
4
- data.tar.gz: 5f2d97634bd50b0fa7249f304e4ccfb85b804c45
3
+ metadata.gz: b9489e08312851b074eae2bfd9d42b528fd185cb
4
+ data.tar.gz: 804b1b08c7831f36ef0a5be3c497f51b0a7d1c11
5
5
  SHA512:
6
- metadata.gz: a9d7ebd703e95010785c0ffe50414f2f6734b0455e701f21467cf5cd43fbc0506db82bfcffbf5619c9471098f9009d3b74c35b605629a2aeb504f8f2902cf6fb
7
- data.tar.gz: 36c7ba7d31fb4d657bc611526aad50bd20a1d961c8c6321a0ceb320804a1244999ea7fc127743f3afc3649a709202887c5f316396a9cddacaa3dab77186404f2
6
+ metadata.gz: cfe5ac146709ea2e8bc149a268d780223a43553065489f633aafe1a39311c2cb6a6330fe7a123369504bad6698a48a7cd7a71ecdab4d3c33ed8e96908e1d3dad
7
+ data.tar.gz: a1d26579dbea80dfea65eb8b71dd207c4b305440daba140f0430ddecbbd98eac00973ce7056774a5e3b4e7da79b35f1502ea5d4915bdcb302fd06e1cd9e9c30a
@@ -15,7 +15,11 @@ module HashKit
15
15
  end
16
16
  end
17
17
 
18
+ # Convert an object to a hash representation of its instance variables.
19
+ # @return [Hash] if the object is not nil, otherwise nil is returned.
18
20
  def to_hash(obj)
21
+ return nil unless obj
22
+
19
23
  hash = {}
20
24
  obj.instance_variables.each do |key|
21
25
  hash[key[1..-1].to_sym] = deeply_to_hash(obj.instance_variable_get(key))
@@ -1,3 +1,3 @@
1
1
  module HashKit
2
- VERSION = "0.4.6"
2
+ VERSION = "0.4.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaughanbrittonsage
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-19 00:00:00.000000000 Z
11
+ date: 2016-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler