Sha256: 52d1b3a68717d4467d1b506868483c7a6d4176a59967216936851d36ffeddf6d

Contents?: true

Size: 430 Bytes

Versions: 11

Compression:

Stored size: 430 Bytes

Contents

# Used to create a stub response when we didn't get back a real response
module Relevance
  module Tarantula

    class Response
      HASHABLE_ATTRS = [:code, :body, :content_type]
      attr_accessor *HASHABLE_ATTRS

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

    end

  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
codez-tarantula-0.5.5 lib/relevance/tarantula/response.rb
codez-tarantula-0.5.4 lib/relevance/tarantula/response.rb
codez-tarantula-0.5.3 lib/relevance/tarantula/response.rb
codez-tarantula-0.5.1 lib/relevance/tarantula/response.rb
codez-tarantula-0.5.0 lib/relevance/tarantula/response.rb
tarantula-0.5.1 lib/relevance/tarantula/response.rb
tarantula-0.5.0 lib/relevance/tarantula/response.rb
tarantula-0.4.3 lib/relevance/tarantula/response.rb
tarantula-0.4.2 lib/relevance/tarantula/response.rb
tarantula-0.4.1 lib/relevance/tarantula/response.rb
tarantula-0.4.0 lib/relevance/tarantula/response.rb