Sha256: 3c463c32778af4cc2a229dd05954b37c0b083182c6fad65198db8f49883ed301

Contents?: true

Size: 287 Bytes

Versions: 7

Compression:

Stored size: 287 Bytes

Contents

module Twilio
  class Response
    attr_accessor :status_code, :body

    def initialize(status_code, body)
      @status_code = status_code
      body = '{}' if !body || body.empty?
      @body = JSON.parse(body)
    end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
twilio-ruby-5.4.0 lib/twilio-ruby/framework/response.rb
twilio-ruby-5.3.1 lib/twilio-ruby/framework/response.rb
twilio-ruby-5.3.0 lib/twilio-ruby/framework/response.rb
twilio-ruby-5.2.3 lib/twilio-ruby/framework/response.rb
twilio-ruby-5.2.2 lib/twilio-ruby/framework/response.rb
twilio-ruby-5.2.1 lib/twilio-ruby/framework/response.rb
twilio-ruby-5.2.0 lib/twilio-ruby/framework/response.rb