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



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

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

.success(value) ⇒ Success



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

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

Instance Method Details

#defined?Boolean



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

abstract :defined?

#explainEither



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

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

#fetchObject



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

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

#flatmapEither



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

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

#mapEither



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

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

#orEither



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

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

#rejectEither



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

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

#selectEither



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

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