class RFunc::None
Public Class Methods
RFunc::AbstractOption::new
# File lib/rfunc/option.rb, line 205 def initialize super(nil) end
Public Instance Methods
Maintains signiture parity with Some.collect
@param block [Function] the block that can be used to modify the value
(should be a case statement with nil return for non operation)
@return [None] self
# File lib/rfunc/option.rb, line 287 def collect(&block) self end
Counts the number of elements for which the block returns true
@param block [Function] the function that determines whether the
value should be counted
@return [Int] 0 (there is no value to operate on)
# File lib/rfunc/option.rb, line 298 def count(&block) 0 end
Indicates if the Option
has a value
@return [Boolean] true
# File lib/rfunc/option.rb, line 244 def empty? true end
Maintains signiture parity with Some.flat_map
@param block [Function] the function which will operate on the
Option's value (should return an Option)
@return [RFunc::Option] a None
# File lib/rfunc/option.rb, line 255 def flat_map(&block) self end
Maintains signiture parity with Some.flatten
@return [None] self
# File lib/rfunc/option.rb, line 275 def flatten self end
Maintains signiture parity with Some.fold
@param alternate [Any] the value to return if the Option
is a None
@param block [Function] the function which will operate on the
current Option's value
@return [Any] the alternate
# File lib/rfunc/option.rb, line 267 def fold(alternate, &block) alternate end
Determines if the current Option
value satisfies the supplied block
@param block [Function] the function that determines whether the
value satisfies an expectation
@return [Boolean] true because the is no value to violate the supplied block
# File lib/rfunc/option.rb, line 309 def for_all(&block) true end
Returns nil (no value to execute on)
@param block [Function] the function that takes the current Option's value
@return [Nil] nil
# File lib/rfunc/option.rb, line 319 def for_each(&block) nil end
Allows for the return of a replacement value
@param block [Function] a block returning an alternate value
@return [Any] the result of the supplied block
# File lib/rfunc/option.rb, line 215 def get_or_else(&block) yield end