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:



277
278
279
# File 'lib/stupidedi/either.rb', line 277

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

.success(value) ⇒ Success

Returns:



272
273
274
# File 'lib/stupidedi/either.rb', line 272

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

Instance Method Details

#defined?Boolean

Returns:

  • (Boolean)


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

abstract :defined?

#explainEither

Returns:



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

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

#fetchObject

Returns:

  • (Object)


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

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

#flatmapEither

Returns:



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

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

#mapEither

Returns:



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

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

#orEither

Returns:



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

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

#rejectEither

Returns:



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

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

#selectEither

Returns:



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

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