Class: Relevance::Tarantula::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/relevance/tarantula/response.rb

Overview

Used to create a stub response when we didn’t get back a real response

Constant Summary collapse

HASHABLE_ATTRS =
[:code, :body, :content_type]

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Response

Returns a new instance of Response.



6
7
8
9
10
11
# File 'lib/relevance/tarantula/response.rb', line 6

def initialize(hash)
  hash.each do |k,v|
    raise ArgumentError, k unless HASHABLE_ATTRS.member?(k)
    self.instance_variable_set("@#{k}", v)
  end
end