Module: Deterministic::CoreExt::Either
- Included in:
- Object
- Defined in:
- lib/deterministic/core_ext/either.rb
Instance Method Summary collapse
- #attempt_all(context = self, &block) ⇒ Object
- #either? ⇒ Boolean
- #failure? ⇒ Boolean
- #success? ⇒ Boolean
Instance Method Details
#attempt_all(context = self, &block) ⇒ Object
18 19 20 |
# File 'lib/deterministic/core_ext/either.rb', line 18 def attempt_all(context=self, &block) Deterministic::Either::AttemptAll.new(context, &block).call(self) end |
#either? ⇒ Boolean
14 15 16 |
# File 'lib/deterministic/core_ext/either.rb', line 14 def either? success? || failure? end |
#failure? ⇒ Boolean
10 11 12 |
# File 'lib/deterministic/core_ext/either.rb', line 10 def failure? self.is_a? Failure end |
#success? ⇒ Boolean
6 7 8 |
# File 'lib/deterministic/core_ext/either.rb', line 6 def success? self.is_a? Success end |