Module: Fear::Either::Mixin

Included in:
Mixin
Defined in:
lib/fear/either.rb

Overview

Include this mixin to access convenient factory methods.

Examples:

include Fear::Either::Mixin

Right('flower') #=> #<Fear::Right value='flower'>
Left('beaf')    #=> #<Fear::Legt value='beaf'>

Instance Method Summary collapse

Instance Method Details

#Left(value) ⇒ Fear::Left

Examples:

Left(42) #=> #<Fear::Left value=42>

Parameters:

  • value (any)

Returns:



319
320
321
# File 'lib/fear/either.rb', line 319

def Left(value)
  Fear.left(value)
end

#Right(value) ⇒ Fear::Right

Examples:

Right(42) #=> #<Fear::Right value=42>

Parameters:

  • value (any)

Returns:



328
329
330
# File 'lib/fear/either.rb', line 328

def Right(value)
  Fear.right(value)
end