Class: Routemaster::Cache::FutureResponse

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#bodyHashie::Mash

Delegated to the block's return value.

Returns:

  • (Hashie::Mash)


59
# File 'lib/routemaster/cache.rb', line 59

delegate :value => :@future

#headersHash

Delegated to the block's return value.

Returns:

  • (Hash)


# File 'lib/routemaster/cache.rb', line 51


#statusInteger

Delegated to the block's return value.

Returns:

  • (Integer)


# File 'lib/routemaster/cache.rb', line 47