Class: MrDarcy::Promise::State::Unresolved

Inherits:
Base
  • Object
show all
Defined in:
lib/mr_darcy/promise/state/unresolved.rb

Overview

Represents the unresolved state of a promise.

Instance Method Summary collapse

Methods inherited from Base

#initialize, #rejected?, #resolved?

Constructor Details

This class inherits a constructor from MrDarcy::Promise::State::Base

Instance Method Details

#rejectObject

Transition into rejected state.



16
17
18
# File 'lib/mr_darcy/promise/state/unresolved.rb', line 16

def reject
  set_state :rejected
end

#resolveObject

Transition into resolved state.



11
12
13
# File 'lib/mr_darcy/promise/state/unresolved.rb', line 11

def resolve
  set_state :resolved
end

#unresolved?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/mr_darcy/promise/state/unresolved.rb', line 6

def unresolved?
  true
end