Class: Mercanet::Response
- Inherits:
-
Object
- Object
- Mercanet::Response
- Defined in:
- lib/mercanet/response.rb
Instance Attribute Summary collapse
-
#hash_data ⇒ Object
Returns the value of attribute hash_data.
Instance Method Summary collapse
-
#initialize(params) ⇒ Response
constructor
A new instance of Response.
- #is_valid? ⇒ Boolean
Constructor Details
#initialize(params) ⇒ Response
Returns a new instance of Response.
4 5 6 7 8 9 10 11 |
# File 'lib/mercanet/response.rb', line 4 def initialize(params) data = params['Data'].split('|') @hash_data = {} data.each do |d| array = d.split('=') @hash_data[array.first.underscore] = array.last end end |
Instance Attribute Details
#hash_data ⇒ Object
Returns the value of attribute hash_data.
3 4 5 |
# File 'lib/mercanet/response.rb', line 3 def hash_data @hash_data end |
Instance Method Details
#is_valid? ⇒ Boolean
13 14 15 |
# File 'lib/mercanet/response.rb', line 13 def is_valid? @hash_data['response_code'] == '00' end |