Class: EzpayInvoice::Response
- Inherits:
-
Object
- Object
- EzpayInvoice::Response
- Defined in:
- lib/ezpay-invoice/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(rest_response) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(rest_response) ⇒ Response
Returns a new instance of Response.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ezpay-invoice/response.rb', line 9 def initialize(rest_response) response_hash = JSON.parse(rest_response.body) raise EzpayResponseError.new( response_hash['Message'], response_hash['Status'] ) if response_hash['Status'] != 'SUCCESS' @body = response_hash @status = response_hash['Status'] @message = response_hash['Message'] @result = transform_keys(JSON.parse(response_hash['Result'])) parse_item_detail end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/ezpay-invoice/response.rb', line 7 def body @body end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/ezpay-invoice/response.rb', line 7 def @message end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
7 8 9 |
# File 'lib/ezpay-invoice/response.rb', line 7 def result @result end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/ezpay-invoice/response.rb', line 7 def status @status end |