Class: Restify::Promise::Writer
- Inherits:
-
Object
- Object
- Restify::Promise::Writer
- Defined in:
- lib/restify/promise.rb
Instance Method Summary collapse
- #fulfill(value) ⇒ Object
-
#initialize(promise) ⇒ Writer
constructor
A new instance of Writer.
- #reject(reason) ⇒ Object
Constructor Details
#initialize(promise) ⇒ Writer
Returns a new instance of Writer.
85 86 87 |
# File 'lib/restify/promise.rb', line 85 def initialize(promise) @promise = promise end |
Instance Method Details
#fulfill(value) ⇒ Object
89 90 91 |
# File 'lib/restify/promise.rb', line 89 def fulfill(value) @promise.send :complete, true, value, nil end |
#reject(reason) ⇒ Object
93 94 95 |
# File 'lib/restify/promise.rb', line 93 def reject(reason) @promise.send :complete, false, nil, reason end |