rclosner/agent_cooper

View on GitHub
lib/agent_cooper/response.rb

Summary

Maintainability
A
0 mins
Test Coverage
module AgentCooper
  class Response

    def initialize(attributes)
      @response = attributes.fetch(:response)
    end

    def body
      response.body
    end

    def code
      response.code
    end

    def to_hash
      MultiXml.parse(body)
    end

    def valid?
      code == 200
    end

    protected

    attr_reader :response

  end
end