Sha256: 40c6eded5cad1a45389ab2cb4496a834cba6ee5b025b01bc63c2178439863fed
Contents?: true
Size: 819 Bytes
Versions: 14
Compression:
Stored size: 819 Bytes
Contents
module Rents class Status < Rents::Connection # Attrs attr_accessor :message # API response message attr_accessor :http_code # HTTP Code for the request attr_accessor :api_code # Internal system response code # Constructor def initialize(params = {}) super # call it super initialize self.path = "status" check_it end # Check it status and "setup" it attrs def check_it self.path = 'status' resp = get_request hash_resp = JSON.parse(resp).it_keys_to_sym self.http_code = resp.code self.message = "EndPoint not response(connection error): #{self.url_requested}" if self.http_code != 200 self.message = hash_resp[:message] if self.http_code == 200 self.api_code = hash_resp[:api_code] return self end end end
Version data entries
14 entries across 14 versions & 1 rubygems