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
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?
|
36
|
# File 'lib/stupidedi/either.rb', line 36
abstract :explain, :args => %w(&block)
|
#fetch ⇒ Object
39
|
# File 'lib/stupidedi/either.rb', line 39
abstract :fetch, :args => %w(default)
|
30
|
# File 'lib/stupidedi/either.rb', line 30
abstract :flatmap, :args => %w(&block)
|
27
|
# File 'lib/stupidedi/either.rb', line 27
abstract :map, :args => %w(&block)
|
33
|
# File 'lib/stupidedi/either.rb', line 33
abstract :or, :args => %w(&block)
|
18
|
# File 'lib/stupidedi/either.rb', line 18
abstract :reject, :args => %w(reason='reject' &block)
|
15
|
# File 'lib/stupidedi/either.rb', line 15
abstract :select, :args => %w(reason='select' &block)
|