Sha256: 573a763eb6456dd665b22ed04a2e4b88bae17e193cd177be01e17ddfd1e63533

Contents?: true

Size: 430 Bytes

Versions: 3

Compression:

Stored size: 430 Bytes

Contents

module Tolq
  module Api
    # Wraps the responses of the Tolq Api
    class Response
      attr_reader :status, :body

      def initialize(status:, body:)
        raise ArgumentError.new('Expected body to be a string') unless !body || body.is_a?(String)

        @status = status.to_i
        @body = body
      end

      def ==(other)
        self.status == other.status && self.body == other.body
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tolq-api-0.4.0 lib/tolq-api/response.rb
tolq-api-0.3.0 lib/tolq-api/response.rb
tolq-api-0.2.0 lib/tolq-api/response.rb