Sha256: b2d7e4dbc8a5094b885f712570128e4ef5ee4694c270f84bf4daaf76b46cee4c
Contents?: true
Size: 695 Bytes
Versions: 23
Compression:
Stored size: 695 Bytes
Contents
module MyJohnDeere class Response attr_accessor :request_id attr_accessor :http_body attr_accessor :http_headers attr_accessor :http_status attr_accessor :data def initialize(response) self.http_headers = {} response.each_capitalized_name do |n| self.http_headers[n] = response[n] end self.http_body = response.body if response.body then begin self.data = JSON.parse(response.body) rescue JSON::ParserError self.data = nil end else self.data = nil end self.http_status = response.code.to_i end def code return http_status end end end
Version data entries
23 entries across 23 versions & 1 rubygems