hashable 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -1
- data/lib/hashable/hashable.rb +6 -4
- data/lib/hashable/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Hashable
|
2
|
+
[![Build Status](https://travis-ci.org/mustafaturan/hashable.png)](https://travis-ci.org/mustafaturan/hashable) [![Code Climate](https://codeclimate.com/github/mustafaturan/hashable.png)](https://codeclimate.com/github/mustafaturan/hashable)
|
2
3
|
|
3
|
-
|
4
|
+
Recursively convert your objects into nested hashes.
|
4
5
|
|
5
6
|
## Installation
|
6
7
|
|
data/lib/hashable/hashable.rb
CHANGED
@@ -14,18 +14,20 @@ module Hashable
|
|
14
14
|
protected
|
15
15
|
# nodoc
|
16
16
|
def convert_hash_values(hash)
|
17
|
+
new_hash = {}
|
17
18
|
hash.each do |key, val|
|
18
|
-
|
19
|
+
new_hash[key] = deeply_to_hash(val)
|
19
20
|
end
|
20
|
-
|
21
|
+
new_hash
|
21
22
|
end
|
22
23
|
|
23
24
|
# nodoc
|
24
25
|
def convert_array_values(array)
|
26
|
+
new_array = []
|
25
27
|
array.each_index do |index|
|
26
|
-
|
28
|
+
new_array[index] = deeply_to_hash(array[index])
|
27
29
|
end
|
28
|
-
|
30
|
+
new_array
|
29
31
|
end
|
30
32
|
|
31
33
|
# nodoc
|
data/lib/hashable/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hashable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|