Class: Routemaster::Cache::FutureResponse
- Inherits:
-
Object
- Object
- Routemaster::Cache::FutureResponse
- Extended by:
- Forwardable
- Defined in:
- lib/routemaster/cache.rb
Overview
Wraps a future response, so it quacks exactly like an ordinary response.
Instance Attribute Summary collapse
-
#body ⇒ Hashie::Mash
Delegated to the
block's return value. -
#headers ⇒ Hash
Delegated to the
block's return value. -
#status ⇒ Integer
Delegated to the
block's return value.
Instance Method Summary collapse
-
#initialize(&block) ⇒ FutureResponse
constructor
The
blockis expected to return a Response.
Constructor Details
#initialize(&block) ⇒ FutureResponse
The block is expected to return a Response
43 44 45 |
# File 'lib/routemaster/cache.rb', line 43 def initialize(&block) @future = Pool.instance.future(&block) end |
Instance Attribute Details
#body ⇒ Hashie::Mash
Delegated to the block's return value.
59 |
# File 'lib/routemaster/cache.rb', line 59 delegate :value => :@future |
#headers ⇒ Hash
Delegated to the block's return value.
|
|
# File 'lib/routemaster/cache.rb', line 51
|
#status ⇒ Integer
Delegated to the block's return value.
|
|
# File 'lib/routemaster/cache.rb', line 47
|