class MrDarcy::Promise::Synchronous

An implementation of synchronous promises, only for testing because it violates several rules of promises.

Public Instance Methods

final() click to toggle source
# File lib/mr_darcy/promise/synchronous.rb, line 14
def final
  self
end
result() click to toggle source
# File lib/mr_darcy/promise/synchronous.rb, line 10
def result
  value
end

Private Instance Methods

generate_child_promise() click to toggle source
# File lib/mr_darcy/promise/synchronous.rb, line 24
def generate_child_promise
  ChildPromise.new driver: :synchronous
end
schedule_promise() { || ... } click to toggle source
# File lib/mr_darcy/promise/synchronous.rb, line 20
def schedule_promise
  yield
end