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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
- metadata.gz: 60dc46874b353a8194a935de7f3dbd539be5dce8
4
- data.tar.gz: 4b07a4ac506666b9f63688606571ec0fddf31c4e
3
+ metadata.gz: 90cfce0b4349e91d4bfffef40b43e0af19059736
4
+ data.tar.gz: e884171e97bc5da9e41908273c66188e4e267bbd
5
5
  SHA512:
6
- metadata.gz: e256d283c41f2715e7760aeafadd05c0c371d2d90c7cbfb83ba826207bbe1bea102c6a164004a07f6c6a976c9988fa5afb5417c400efaeb584083daf7b7d1798
7
- data.tar.gz: 54c4cf5172f9d89bc1a282fa0e7bf9a1e035e68e670c13f09fcc7023da5aedcf3c2d92ed493728491bcd4731a3688cfddcb46b6f1848955fc9fd617a640c3933
6
+ metadata.gz: 72f06837124bfe8d0b74b1335b64aaf337ace9f50259387c94a5db166bf239fa53c157f0c757a53d356496c48f08c54fb9b6091a8e031b92f2abfaa88ca147f8
7
+ data.tar.gz: 5407ac5707a4a5e2bca0f607559215c5f75324b6280bae8875efd26c51c52db3d5d8dd7e731baca1d13ae0c311d2bb77c1902ceffd8d09cdd880bb8d90f6a116
@@ -1,3 +1,3 @@
1
1
  class BetterStruct
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/better_struct.rb CHANGED
@@ -63,6 +63,14 @@ private
63
63
  end
64
64
 
65
65
  def unwrap_items(wrapped_array)
66
- wrap(wrapped_array.value.map(&:value))
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: better_struct
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeny Li