Class: Ravelin::Response
- Inherits:
-
Object
- Object
- Ravelin::Response
- Defined in:
- lib/ravelin/response.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#http_body ⇒ Object
readonly
Returns the value of attribute http_body.
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#score_id ⇒ Object
readonly
Returns the value of attribute score_id.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(faraday_response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(faraday_response) ⇒ Response
Returns a new instance of Response.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/ravelin/response.rb', line 12 def initialize(faraday_response) return if faraday_response.body.nil? || faraday_response.body.empty? data = faraday_response.body.fetch('data', {}) @customer_id = data['customerId'] @action = data['action'] @score = data['score'] @score_id = data['scoreId'] @source = data['source'] @comment = data['comment'] @customer_id = data['customerId'] @http_status = faraday_response.status @http_body = faraday_response.body end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/ravelin/response.rb', line 3 def action @action end |
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
3 4 5 |
# File 'lib/ravelin/response.rb', line 3 def comment @comment end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
3 4 5 |
# File 'lib/ravelin/response.rb', line 3 def customer_id @customer_id end |
#http_body ⇒ Object (readonly)
Returns the value of attribute http_body.
3 4 5 |
# File 'lib/ravelin/response.rb', line 3 def http_body @http_body end |
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
3 4 5 |
# File 'lib/ravelin/response.rb', line 3 def http_status @http_status end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
3 4 5 |
# File 'lib/ravelin/response.rb', line 3 def score @score end |
#score_id ⇒ Object (readonly)
Returns the value of attribute score_id.
3 4 5 |
# File 'lib/ravelin/response.rb', line 3 def score_id @score_id end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
3 4 5 |
# File 'lib/ravelin/response.rb', line 3 def source @source end |