Module: Philiprehberger::Maybe
- Defined in:
- lib/philiprehberger/maybe.rb,
lib/philiprehberger/maybe/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
'0.2.1'
Class Method Summary collapse
-
.all?(*maybes) ⇒ Boolean
Check if all arguments are Some.
-
.first_some(*maybes) ⇒ Some, None
Return the first Some from the arguments, or None if all are None.
-
.wrap(value) ⇒ Some, None
Wrap a value in a Maybe container.
Class Method Details
.all?(*maybes) ⇒ Boolean
Check if all arguments are Some
26 27 28 |
# File 'lib/philiprehberger/maybe.rb', line 26 def self.all?(*maybes) maybes.all?(&:some?) end |