Class: When::Promise

Inherits:
Object
  • Object
show all
Defined in:
lib/when.rb

Instance Method Summary collapse

Constructor Details

#initialize(deferred) ⇒ Promise

Returns a new instance of Promise.



28
# File 'lib/when.rb', line 28

def initialize(deferred); @deferred = deferred; end

Instance Method Details

#callback(&block) ⇒ Object



30
# File 'lib/when.rb', line 30

def callback(&block); @deferred.callback(&block); end

#errback(&block) ⇒ Object



31
# File 'lib/when.rb', line 31

def errback(&block); @deferred.errback(&block); end

#then(&block) ⇒ Object



29
# File 'lib/when.rb', line 29

def then(&block); @deferred.then(&block); end