File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change
1
+ require 'concurrent/synchronization'
2
+
1
3
module Concurrent
2
4
3
5
# A `Maybe` encapsulates an optional value. A `Maybe` either contains a value
@@ -99,8 +101,9 @@ module Concurrent
99
101
#
100
102
# @see https://hackage.haskell.org/package/base-4.2.0.1/docs/Data-Maybe.html Haskell Data.Maybe
101
103
# @see https://github.com/purescript/purescript-maybe/blob/master/docs/Data.Maybe.md PureScript Data.Maybe
102
- class Maybe
104
+ class Maybe < Synchronization :: Object
103
105
include Comparable
106
+ safe_initialization!
104
107
105
108
# Indicates that the given attribute has not been set.
106
109
# When `Just` the {#nothing} getter will return `NONE`.
@@ -168,15 +171,15 @@ def self.nothing(error = '')
168
171
end
169
172
170
173
# Is this `Maybe` a `Just` (successfully fulfilled with a value)?
171
- #
174
+ #
172
175
# @return [Boolean] True if `Just` or false if `Nothing`.
173
176
def just?
174
177
! nothing?
175
178
end
176
179
alias :fulfilled? :just?
177
180
178
181
# Is this `Maybe` a `nothing` (rejected with an exception upon fulfillment)?
179
- #
182
+ #
180
183
# @return [Boolean] True if `Nothing` or false if `Just`.
181
184
def nothing?
182
185
@nothing != NONE
You can’t perform that action at this time.
0 commit comments