Class: Webmachine::Sprockets::Resource

Inherits:
Resource
  • Object
show all
Defined in:
lib/webmachine/sprockets/resource.rb

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResource

Returns a new instance of Resource.



10
11
12
# File 'lib/webmachine/sprockets/resource.rb', line 10

def initialize
  @rack_response = call_sprockets(rack_env)
end

Class Attribute Details

.sprocketsObject

Returns the value of attribute sprockets.



7
8
9
# File 'lib/webmachine/sprockets/resource.rb', line 7

def sprockets
  @sprockets
end

Instance Method Details

#finish_requestObject



14
15
16
17
18
19
# File 'lib/webmachine/sprockets/resource.rb', line 14

def finish_request
  response.code = @rack_response[0]
  response.headers.clear
  response.headers.merge!(@rack_response[1])
  response.body = Enumerator.new(@rack_response[2]).to_a.join
end