Class: When::Promise
- Inherits:
-
Object
- Object
- When::Promise
- Defined in:
- lib/when.rb
Instance Method Summary collapse
- #callback(&block) ⇒ Object
- #errback(&block) ⇒ Object
-
#initialize(deferred) ⇒ Promise
constructor
A new instance of Promise.
- #then(&block) ⇒ Object
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 |