k_builder 0.0.26 → 0.0.27

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
  SHA256:
3
- metadata.gz: ec75b1356060e7075bd481790769fb8f3fd80112a07247fb3a5ac1f6bac36993
4
- data.tar.gz: 388c3f334b6864e973a4fbfd1f41d6bdbf769c3b58fb5d72a9bafeb847e11656
3
+ metadata.gz: ad123a63da5538fbf3c598f39f6af371760f01dcd90320f7d4c43cfa081c2a04
4
+ data.tar.gz: b851793f9e4716209fc5a49183d4bb49257e71648515a0dfb4c185581adbd604
5
5
  SHA512:
6
- metadata.gz: e6937c692f052d1ec7b0f6abae35cce72e775e65a962e05ca21ba5dda647cb85c3215fb465e86ba76428bffc66038727afde3ca60666920773467bc36996cbef
7
- data.tar.gz: 3988883cfe6543a2c97fe56c4b99bf634b4a77c3210eccf2d1e56711d045729144aa0735edd94238c400f9ed82fcf7db847343949e0d04b325fa66f52c0073b6
6
+ metadata.gz: 1f528ed1fecbc4776e7a5315d844207bb819e9cda4a4b43ff508ccbaf56e4b1e844f53824f50857a57051b8d5b5c8f7b3aeea0528767cb2dd809e1b55c2077cf
7
+ data.tar.gz: 38f600a8f7016f6f8aed25b5745122efd8b1e7e3f10a77d47a56cee3b54b2885ac7f563f8e1bba1d3ee17ef00fda870b98764ff858e256b47835dfc55e034dbb
@@ -40,11 +40,13 @@ module KBuilder
40
40
 
41
41
  data.each_pair.with_object({}) do |(key, value), hash|
42
42
  case value
43
- when OpenStruct
43
+ when OpenStruct, Struct, Hash
44
44
  hash[key] = struct_to_hash(value)
45
45
  when Array
46
46
  # No test yet
47
- values = value.map { |v| v.is_a?(OpenStruct) ? struct_to_hash(v) : v }
47
+ values = value.map do |v|
48
+ v.is_a?(OpenStruct) || v.is_a?(Struct) || v.is_a?(Hash) ? struct_to_hash(v) : v
49
+ end
48
50
  hash[key] = values
49
51
  else
50
52
  hash[key] = value
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KBuilder
4
- VERSION = '0.0.26'
4
+ VERSION = '0.0.27'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: k_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys