yamlcon 0.1.1 → 0.1.2

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: 4e20cdf8184f40ac4e5f6d078b9b1acd2c901ae9
4
- data.tar.gz: 63706b2369c60c78b3020516d1a91e3579c351cc
3
+ metadata.gz: bf073fafcfc37a848b85cda5d8edb43350da69cb
4
+ data.tar.gz: 26e7a381b68fbc33f8b99609805ef9633e67f8f2
5
5
  SHA512:
6
- metadata.gz: 1b1cb5c6315d63fbcddf8d655becadbe8926f9a1356b5e74c3df6c41ad7b66225d33ed3ca13cf54f75bd844ad20f7f8e97d3c061e875d2911f4bf6b787fdbbaa
7
- data.tar.gz: 101d8b064d920fcf5e13d06a709467c0e2da127a628ace46fcb4c6c4f46174db8a94b9ca78b7d810b51b56df646ad63dce168bcc3670778b70d7722eb58d9a58
6
+ metadata.gz: 38f412b87a0beaa229648f84d703aba13dced5473774280a92ac7dc1e24340ad8b2e13d0ae3fc774ddd68c0e2a5957f32c6b59297e6d65d1c2326ded046c9a6f
7
+ data.tar.gz: 17340c5900fc5536c7d5b04ba6060069efbb0796e89a37cbce9dc77638a4fbc0960b5b6f94bb9d651b23577355a87e432ac8c14c7836490781c8bf6f771d3920
@@ -1,3 +1,3 @@
1
1
  module YAMLCon
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -14,10 +14,17 @@ module YAMLCon
14
14
  end
15
15
 
16
16
  def self.hash_to_struct(hash)
17
+ return hash unless hash.is_a? Hash
17
18
  dotted = OpenStruct.new hash
18
- hash.each do |k, v|
19
- dotted[k] = hash_to_struct(v) if v.is_a? Hash
19
+
20
+ hash.each do |key, value|
21
+ if value.is_a? Hash
22
+ dotted[key] = hash_to_struct(value)
23
+ elsif value.is_a? Array
24
+ dotted[key] = value.collect {|item| hash_to_struct item }
25
+ end
20
26
  end
27
+
21
28
  dotted
22
29
  end
23
30
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yamlcon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-18 00:00:00.000000000 Z
11
+ date: 2016-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: runfile