Class: Minfraud::HTTPService::Response
- Inherits:
-
Object
- Object
- Minfraud::HTTPService::Response
- Defined in:
- lib/minfraud/http_service/response.rb
Overview
Response class for HTTP requests.
Instance Attribute Summary collapse
-
#body ⇒ Minfraud::Model::Score, ...
readonly
Response model.
-
#status ⇒ Fixnum?
readonly
Response HTTP status code.
Instance Method Summary collapse
-
#code ⇒ Symbol?
Return the minFraud-specific response code.
-
#initialize(endpoint, locales, response, body) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(endpoint, locales, response, body) ⇒ Response
Returns a new instance of Response.
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/minfraud/http_service/response.rb', line 33 def initialize(endpoint, locales, response, body) @status = response.code @body = make_body( endpoint, locales, response, body, ) end |
Instance Attribute Details
#body ⇒ Minfraud::Model::Score, ... (readonly)
Response model.
22 23 24 |
# File 'lib/minfraud/http_service/response.rb', line 22 def body @body end |
#status ⇒ Fixnum? (readonly)
Response HTTP status code.
16 17 18 |
# File 'lib/minfraud/http_service/response.rb', line 16 def status @status end |
Instance Method Details
#code ⇒ Symbol?
Return the minFraud-specific response code.
47 48 49 50 51 |
# File 'lib/minfraud/http_service/response.rb', line 47 def code return nil if body.nil? body.code.intern if body.respond_to?(:code) && body.code end |