Sha256: 33aac7e4d50e47f983193f6a6f7cd46d531cec68d7922223d3ff7bf7961db62b

Contents?: true

Size: 471 Bytes

Versions: 17

Compression:

Stored size: 471 Bytes

Contents

# frozen_string_literal: true

module Mock
  module Twilio
    class Response
      attr_accessor :status_code, :body, :headers

      def initialize(status_code, body, request, headers: nil)
        @status_code = status_code
        body = '{}' if !body || body.empty?
        @body = Mock::Twilio::Decorator.call(body, request)
        @headers = !headers ? {} : headers.to_hash
      end

      def to_s
        "[#{status_code}] #{body}"
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mock-twilio-1.4 lib/mock/twilio/response.rb
mock-twilio-1.3.2 lib/mock/twilio/response.rb
mock-twilio-1.3.1 lib/mock/twilio/response.rb
mock-twilio-1.3.0 lib/mock/twilio/response.rb
mock-twilio-1.2.0 lib/mock/twilio/response.rb
mock-twilio-1.1.0 lib/mock/twilio/response.rb
mock-twilio-1.0.0 lib/mock/twilio/response.rb
mock-twilio-0.8.0 lib/mock/twilio/response.rb
mock-twilio-0.7.2 lib/mock/twilio/response.rb
mock-twilio-0.7.1 lib/mock/twilio/response.rb
mock-twilio-0.7.0 lib/mock/twilio/response.rb
mock-twilio-0.6.0 lib/mock/twilio/response.rb
mock-twilio-0.5.0 lib/mock/twilio/response.rb
mock-twilio-0.4.0 lib/mock/twilio/response.rb
mock-twilio-0.3.0 lib/mock/twilio/response.rb
mock-twilio-0.2.0 lib/mock/twilio/response.rb
mock-twilio-0.1.0 lib/mock/twilio/response.rb