Sha256: ec7ed3bf6b7deac497e65d87c902917dbaba3f4eb9afa51f997b477f4bd2df16
Contents?: true
Size: 809 Bytes
Versions: 13
Compression:
Stored size: 809 Bytes
Contents
module Unimatrix::Authorization class Response < Unimatrix::Response attr_reader :code attr_reader :body attr_reader :resources def initialize( http_response, path = "" ) @request_path = path @success = http_response.is_a?( Net::HTTPOK ) @code = http_response.code @resources = [] @body = decode_response_body( http_response ) if ( @body && @body.respond_to?( :keys ) ) Parser.new( @body, @request_path ) do | parser | @resources = parser.resources @success = !( parser.type_name == 'error' ) end else @success = false @resources << Unimatrix::Error.new( message: "#{ @code }: #{ http_response.message }." ) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems