Sha256: b45da49e6fcc328dfcf78bd743e3e33fe78fc647e4a6987371e7d433c63f7cb1

Contents?: true

Size: 297 Bytes

Versions: 24

Compression:

Stored size: 297 Bytes

Contents

module Twilio
  class TwilioResponse
    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

24 entries across 24 versions & 1 rubygems

Version Path
twilio-ruby-5.0.0.rc26 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc25 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc24 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc23 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc22 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc21 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc20 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc19 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc18 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc17 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc16 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc15 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc14 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc13 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc12 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc11 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc10 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc9 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc8 lib/twilio-ruby/framework/twilio_response.rb
twilio-ruby-5.0.0.rc7 lib/twilio-ruby/framework/twilio_response.rb