Class: Stupidedi::Either
- Inherits:
-
Object
show all
- Defined in:
- lib/stupidedi/either.rb
Defined Under Namespace
Classes: Failure, Success
Filtering the Value
collapse
Transforming the Value
collapse
Instance Method Summary
collapse
Class Method Details
.failure(reason) ⇒ Failure
274
275
276
|
# File 'lib/stupidedi/either.rb', line 274
def failure(reason)
Either::Failure.new(reason)
end
|
.success(value) ⇒ Success
269
270
271
|
# File 'lib/stupidedi/either.rb', line 269
def success(value)
Either::Success.new(value)
end
|
Instance Method Details
#defined? ⇒ Boolean
7
|
# File 'lib/stupidedi/either.rb', line 7
abstract :defined?
|
#explain(&block) ⇒ Either
34
|
# File 'lib/stupidedi/either.rb', line 34
abstract :explain, :args => %w(&block)
|
#fetch(default) ⇒ Object
37
|
# File 'lib/stupidedi/either.rb', line 37
abstract :fetch, :args => %w(default)
|
#flatmap(&block) ⇒ Either
28
|
# File 'lib/stupidedi/either.rb', line 28
abstract :flatmap, :args => %w(&block)
|
#map(&block) ⇒ Either
25
|
# File 'lib/stupidedi/either.rb', line 25
abstract :map, :args => %w(&block)
|
#or(&block) ⇒ Either
31
|
# File 'lib/stupidedi/either.rb', line 31
abstract :or, :args => %w(&block)
|
#reject(reason = 'reject', &block) ⇒ Either
16
|
# File 'lib/stupidedi/either.rb', line 16
abstract :reject, :args => %w(reason='reject' &block)
|
#select(reason = 'select', &block) ⇒ Either
13
|
# File 'lib/stupidedi/either.rb', line 13
abstract :select, :args => %w(reason='select' &block)
|