Sha256: 5fde269e0422215b0afba0f5d288b2913f7d61cd8ed1a50f5a16d419be18c749

Contents?: true

Size: 360 Bytes

Versions: 1

Compression:

Stored size: 360 Bytes

Contents

require 'json'

module Gaurun
  class Response
    def initialize(res)
      @res = res
    end

    def status_code
      @res.response_code.to_i
    end

    def status_message
      @res.return_code
    end

    def body
      return nil unless @res.response_body.length > 1
      JSON.parse(@res.response_body, { symbolize_names: true })
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gaurun-ruby-0.2.4 lib/gaurun-ruby/response.rb