Class: Gestpay::Result::Base
- Inherits:
-
Object
- Object
- Gestpay::Result::Base
- Defined in:
- lib/gestpay/result/base.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #error ⇒ Object
-
#initialize(data) ⇒ Base
constructor
A new instance of Base.
- #method_missing(method_name, *args) ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ Base
Returns a new instance of Base.
7 8 9 |
# File 'lib/gestpay/result/base.rb', line 7 def initialize(data) @data = data end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
19 20 21 |
# File 'lib/gestpay/result/base.rb', line 19 def method_missing(method_name, *args) data.has_key?(method_name) ? data[method_name] : super end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/gestpay/result/base.rb', line 5 def data @data end |
Instance Method Details
#error ⇒ Object
15 16 17 |
# File 'lib/gestpay/result/base.rb', line 15 def error "Error #{ error_code }: #{ error_description }" if error_code end |
#success? ⇒ Boolean
11 12 13 |
# File 'lib/gestpay/result/base.rb', line 11 def success? transaction_result == 'OK' end |