Class: LazopApiClient::Response
- Inherits:
-
Object
- Object
- LazopApiClient::Response
- Defined in:
- lib/lazop_api_client.rb
Instance Method Summary collapse
- #body ⇒ Object
- #code ⇒ Object
-
#initialize(type, code, message, r_id, body) ⇒ Response
constructor
A new instance of Response.
- #message ⇒ Object
- #request_id ⇒ Object
- #success? ⇒ Boolean
- #type ⇒ Object
Constructor Details
#initialize(type, code, message, r_id, body) ⇒ Response
Returns a new instance of Response.
217 218 219 220 221 222 223 |
# File 'lib/lazop_api_client.rb', line 217 def initialize(type,code,,r_id,body) @type = type @code = code @message = @body = body @request_id = r_id end |
Instance Method Details
#body ⇒ Object
243 244 245 246 |
# File 'lib/lazop_api_client.rb', line 243 def body # http response body, contains all fileds @body end |
#code ⇒ Object
234 235 236 237 |
# File 'lib/lazop_api_client.rb', line 234 def code # response code, 0 is no error @code end |
#message ⇒ Object
239 240 241 |
# File 'lib/lazop_api_client.rb', line 239 def @message end |
#request_id ⇒ Object
248 249 250 251 |
# File 'lib/lazop_api_client.rb', line 248 def request_id # api uniqe request id @request_id end |
#success? ⇒ Boolean
253 254 255 |
# File 'lib/lazop_api_client.rb', line 253 def success? @code == '0' end |
#type ⇒ Object
225 226 227 228 229 230 231 232 |
# File 'lib/lazop_api_client.rb', line 225 def type # response type nil,ISP,ISV,SYSTEM # nil :no error # ISP : API Service Provider Error # ISV : API Request Client Error # SYSTEM : Lazop platform Error @type end |