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.
86 87 88 |
# File 'lib/restify/promise.rb', line 86 def initialize(promise) @promise = promise end |
Instance Method Details
#fulfill(value) ⇒ Object
90 91 92 |
# File 'lib/restify/promise.rb', line 90 def fulfill(value) @promise.send :complete, true, value, nil end |
#reject(reason) ⇒ Object
94 95 96 |
# File 'lib/restify/promise.rb', line 94 def reject(reason) @promise.send :complete, false, nil, reason end |