Class: Probject::Future
- Inherits:
-
Object
- Object
- Probject::Future
- Defined in:
- lib/probject/future.rb
Instance Method Summary collapse
- #done? ⇒ Boolean
- #get ⇒ Object
- #get! ⇒ Object
-
#initialize(response_handler, id) ⇒ Future
constructor
A new instance of Future.
Constructor Details
#initialize(response_handler, id) ⇒ Future
Returns a new instance of Future.
3 4 5 6 |
# File 'lib/probject/future.rb', line 3 def initialize(response_handler, id) @response_handler = response_handler @id = id end |
Instance Method Details
#done? ⇒ Boolean
18 19 20 |
# File 'lib/probject/future.rb', line 18 def done? @response_handler.done? @id end |
#get ⇒ Object
8 9 10 |
# File 'lib/probject/future.rb', line 8 def get @response_handler.get @id end |
#get! ⇒ Object
12 13 14 15 16 |
# File 'lib/probject/future.rb', line 12 def get! response = get raise response if response.kind_of? Exception response end |