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 +4 -4
- data/lib/hash_kit/helper.rb +4 -0
- data/lib/hash_kit/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: b9489e08312851b074eae2bfd9d42b528fd185cb
|
4
|
+
data.tar.gz: 804b1b08c7831f36ef0a5be3c497f51b0a7d1c11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfe5ac146709ea2e8bc149a268d780223a43553065489f633aafe1a39311c2cb6a6330fe7a123369504bad6698a48a7cd7a71ecdab4d3c33ed8e96908e1d3dad
|
7
|
+
data.tar.gz: a1d26579dbea80dfea65eb8b71dd207c4b305440daba140f0430ddecbbd98eac00973ce7056774a5e3b4e7da79b35f1502ea5d4915bdcb302fd06e1cd9e9c30a
|
data/lib/hash_kit/helper.rb
CHANGED
@@ -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))
|
data/lib/hash_kit/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|