class_kit 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/class_kit/helper.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dafa96fa9b5a4e0d5b0c498dad30b76fc4f1e7385bffae89a2924bc36e3932c1
|
4
|
+
data.tar.gz: 94779e51e0a4f0730aa937bfb653497a565bd5833ef7479911a1ece12c713223
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6cac82b1b5f66f248a43ebb90813c274e2322dbe9813ad30ecda694ade0085fcedcc3aa1eb88ea69656a8c2863bd2ae2fb6fa7c0697321d458a6b8df203dfa4
|
7
|
+
data.tar.gz: fff56f5479de5a961f8c1e4768667c35ca13c9ba41e7d08fbe54dd7556c3ba01d03a21c3c5dfeef6d75496c3a1971160c0b873ed3dbec91210dd640727063fc9
|
data/lib/class_kit/helper.rb
CHANGED
@@ -29,11 +29,11 @@ module ClassKit
|
|
29
29
|
value = object.public_send(attribute[:name])
|
30
30
|
if value != nil
|
31
31
|
hash[key] = if is_class_kit?(type)
|
32
|
-
to_hash(value)
|
32
|
+
to_hash(value, use_alias)
|
33
33
|
elsif type == Array
|
34
34
|
value.map do |i|
|
35
35
|
if is_class_kit?(i.class)
|
36
|
-
to_hash(i)
|
36
|
+
to_hash(i, use_alias)
|
37
37
|
else
|
38
38
|
i
|
39
39
|
end
|
@@ -62,14 +62,14 @@ module ClassKit
|
|
62
62
|
next if hash[key].nil?
|
63
63
|
|
64
64
|
value = if is_class_kit?(type)
|
65
|
-
from_hash(hash: hash[key], klass: type)
|
65
|
+
from_hash(hash: hash[key], klass: type, use_alias: use_alias)
|
66
66
|
elsif type == Array
|
67
67
|
hash[key].map do |array_element|
|
68
68
|
if attribute[:collection_type].nil?
|
69
69
|
array_element
|
70
70
|
else
|
71
71
|
if is_class_kit?(attribute[:collection_type])
|
72
|
-
from_hash(hash: array_element, klass: attribute[:collection_type])
|
72
|
+
from_hash(hash: array_element, klass: attribute[:collection_type], use_alias: use_alias)
|
73
73
|
else
|
74
74
|
@value_helper.parse(type: attribute[:collection_type], value: array_element)
|
75
75
|
end
|