Class: CubaAPI::Response

Inherits:
Cuba::Response
  • Object
show all
Defined in:
lib/cuba_api.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status = 404, headers = { "Content-Type" => "text/plain; charset=utf-8" }) ⇒ Response

Returns a new instance of Response.



40
41
42
43
# File 'lib/cuba_api.rb', line 40

def initialize( status = 404,
                headers = { "Content-Type" => "text/plain; charset=utf-8" } )
  super
end

Class Method Details

.newObject



36
37
38
# File 'lib/cuba_api.rb', line 36

def self.new
  Thread.current[ :cuba_api_response ] ||= super
end

Instance Method Details

#finishObject



45
46
47
48
# File 'lib/cuba_api.rb', line 45

def finish
  Thread.current[ :cuba_api_response ] = nil
  super
end