better_struct 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/better_struct/version.rb +1 -1
- data/lib/better_struct.rb +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90cfce0b4349e91d4bfffef40b43e0af19059736
|
4
|
+
data.tar.gz: e884171e97bc5da9e41908273c66188e4e267bbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72f06837124bfe8d0b74b1335b64aaf337ace9f50259387c94a5db166bf239fa53c157f0c757a53d356496c48f08c54fb9b6091a8e031b92f2abfaa88ca147f8
|
7
|
+
data.tar.gz: 5407ac5707a4a5e2bca0f607559215c5f75324b6280bae8875efd26c51c52db3d5d8dd7e731baca1d13ae0c311d2bb77c1902ceffd8d09cdd880bb8d90f6a116
|
data/lib/better_struct.rb
CHANGED
@@ -63,6 +63,14 @@ private
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def unwrap_items(wrapped_array)
|
66
|
-
|
66
|
+
array = wrapped_array.value
|
67
|
+
|
68
|
+
if array
|
69
|
+
array_with_unwrapped_items = array.map { |i| i.is_a?(self.class) ? i.value : i }
|
70
|
+
|
71
|
+
wrap(array_with_unwrapped_items)
|
72
|
+
else
|
73
|
+
wrap(nil)
|
74
|
+
end
|
67
75
|
end
|
68
76
|
end
|