Class: Rents::Status
- Inherits:
-
Connection
- Object
- Connection
- Rents::Status
- Defined in:
- lib/rents/status.rb
Instance Attribute Summary collapse
-
#api_code ⇒ Object
Internal system response code.
-
#http_code ⇒ Object
HTTP Code for the request.
-
#message ⇒ Object
Attrs.
Attributes inherited from Connection
#api_version, #auth, #domain, #end_point, #end_point_versioned, #path, #request_params
Instance Method Summary collapse
-
#check_it ⇒ Object
Check it status and “setup” it attrs.
-
#initialize(params = {}) ⇒ Status
constructor
Constructor.
Methods inherited from Connection
#get_json_request, #get_request, #post_json_request, #post_request, #url_requested
Constructor Details
#initialize(params = {}) ⇒ Status
Constructor
9 10 11 12 13 |
# File 'lib/rents/status.rb', line 9 def initialize(params = {}) super # call it super initialize self.path = "status" check_it end |
Instance Attribute Details
#api_code ⇒ Object
Internal system response code
6 7 8 |
# File 'lib/rents/status.rb', line 6 def api_code @api_code end |
#http_code ⇒ Object
HTTP Code for the request
5 6 7 |
# File 'lib/rents/status.rb', line 5 def http_code @http_code end |
#message ⇒ Object
Attrs
4 5 6 |
# File 'lib/rents/status.rb', line 4 def end |
Instance Method Details
#check_it ⇒ Object
Check it status and “setup” it attrs
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rents/status.rb', line 16 def check_it self.path = 'status' resp = get_request hash_resp = JSON.parse(resp).it_keys_to_sym self.http_code = resp.code self. = "EndPoint not response(connection error): #{self.url_requested}" if self.http_code != 200 self. = hash_resp[:message] if self.http_code == 200 self.api_code = hash_resp[:api_code] return self end |