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) ⇒ Left

Parameters:

  • (any)

Returns:



254
255
256
# File 'lib/fear/either.rb', line 254

def Left(value)
  Left.new(value)
end

#Right(value) ⇒ Right

Parameters:

  • (any)

Returns:



260
261
262
# File 'lib/fear/either.rb', line 260

def Right(value)
  Right.new(value)
end