Class: Relevance::Tarantula::Response
- 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
-
#initialize(hash) ⇒ Response
constructor
A new instance of Response.
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 |