Class: Stupidedi::Either

Inherits:
Object
  • Object
show all
Defined in:
lib/stupidedi/either.rb

Direct Known Subclasses

Failure, Success

Defined Under Namespace

Classes: Failure, Success

Filtering the Value collapse

Transforming the Value collapse

Constructors collapse

Instance Method Summary collapse

Class Method Details

.failure(reason) ⇒ Failure

Returns:



279
280
281
# File 'lib/stupidedi/either.rb', line 279

def failure(reason)
  Either::Failure.new(reason)
end

.success(value) ⇒ Success

Returns:



274
275
276
# File 'lib/stupidedi/either.rb', line 274

def success(value)
  Either::Success.new(value)
end

Instance Method Details

#defined?Boolean

Returns:

  • (Boolean)


9
# File 'lib/stupidedi/either.rb', line 9

abstract :defined?

#explainEither

Returns:



36
# File 'lib/stupidedi/either.rb', line 36

abstract :explain, :args => %w(&block)

#fetchObject

Returns:

  • (Object)


39
# File 'lib/stupidedi/either.rb', line 39

abstract :fetch, :args => %w(default)

#flatmapEither

Returns:



30
# File 'lib/stupidedi/either.rb', line 30

abstract :flatmap, :args => %w(&block)

#mapEither

Returns:



27
# File 'lib/stupidedi/either.rb', line 27

abstract :map, :args => %w(&block)

#orEither

Returns:



33
# File 'lib/stupidedi/either.rb', line 33

abstract :or, :args => %w(&block)

#rejectEither

Returns:



18
# File 'lib/stupidedi/either.rb', line 18

abstract :reject, :args => %w(reason='reject' &block)

#selectEither

Returns:



15
# File 'lib/stupidedi/either.rb', line 15

abstract :select, :args => %w(reason='select' &block)