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