Module: ActiveResourceResponse::HttpMock::Response

Defined in:
lib/active_resource_response/http_mock.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

to avoid methods conflict with Net:HttpResponse and ActiveResource::Response (HttpMock)



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/active_resource_response/http_mock.rb', line 29

def self.included(base)
  base.class_eval do
    def to_hash
      Hash[@headers.map{|k, value| [k, Array.wrap(value)] } ]
    end

    remove_method :[]
    def [](key)
      @headers[key]
    end
  end
end