Class: Newebpay::Periodical::Response
- Inherits:
-
Object
- Object
- Newebpay::Periodical::Response
- Defined in:
- lib/newebpay/periodical/response.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(response_params) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(response_params) ⇒ Response
Returns a new instance of Response.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/newebpay/periodical/response.rb', line 6 def initialize(response_params) raw_params = Newebpay::NewebpayHelper.decrypt_data(response_params) response_data = JSON.parse(raw_params) @status = response_data['Status'] @message = response_data['Message'] @result = response_data['Result'] @result.each do |key, values| define_singleton_method(key.underscore) do values end end end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/newebpay/periodical/response.rb', line 5 def @message end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/newebpay/periodical/response.rb', line 5 def status @status end |
Instance Method Details
#success? ⇒ Boolean
21 22 23 |
# File 'lib/newebpay/periodical/response.rb', line 21 def success? status == 'SUCCESS' end |