Module: Deterministic::CoreExt::Either

Included in:
Object
Defined in:
lib/deterministic/core_ext/either.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


14
15
16
# File 'lib/deterministic/core_ext/either.rb', line 14

def either?
  success? || failure?
end

#failure?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/deterministic/core_ext/either.rb', line 10

def failure?
  self.is_a? Failure
end

#success?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/deterministic/core_ext/either.rb', line 6

def success?
  self.is_a? Success
end