module ActiveResourceResponse::HttpMock::Response

Public Class Methods

included(base) click to toggle source

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

# 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

Public Instance Methods

[](key) click to toggle source
# File lib/active_resource_response/http_mock.rb, line 36
def [](key)
  @headers[key]
end
to_hash() click to toggle source
# File lib/active_resource_response/http_mock.rb, line 31
def to_hash
  Hash[@headers.map{|k, value| [k, Array.wrap(value)] } ]
end