Class: Payture::Cheques::Responses::ChequeStatus
- Inherits:
-
Object
- Object
- Payture::Cheques::Responses::ChequeStatus
- Defined in:
- lib/payture/cheques/responses/cheque_status.rb
Instance Attribute Summary collapse
-
#cheque ⇒ Object
readonly
Returns the value of attribute cheque.
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#sent ⇒ Object
readonly
Returns the value of attribute sent.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(data) ⇒ ChequeStatus
constructor
A new instance of ChequeStatus.
- #processed? ⇒ Boolean
- #processing_error? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ ChequeStatus
Returns a new instance of ChequeStatus.
6 7 8 9 10 11 |
# File 'lib/payture/cheques/responses/cheque_status.rb', line 6 def initialize(data) @sent = data['Sended'] @cheque = data['Cheque'] @status = data['Status'] @error_code = data['ErrCode'] || Status::ERROR_STATES[@status] end |
Instance Attribute Details
#cheque ⇒ Object (readonly)
Returns the value of attribute cheque.
4 5 6 |
# File 'lib/payture/cheques/responses/cheque_status.rb', line 4 def cheque @cheque end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
4 5 6 |
# File 'lib/payture/cheques/responses/cheque_status.rb', line 4 def error_code @error_code end |
#sent ⇒ Object (readonly)
Returns the value of attribute sent.
4 5 6 |
# File 'lib/payture/cheques/responses/cheque_status.rb', line 4 def sent @sent end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/payture/cheques/responses/cheque_status.rb', line 4 def status @status end |
Instance Method Details
#processed? ⇒ Boolean
13 14 15 |
# File 'lib/payture/cheques/responses/cheque_status.rb', line 13 def processed? error_code.nil? && @sent == true && @status == 'Created' end |
#processing_error? ⇒ Boolean
17 18 19 |
# File 'lib/payture/cheques/responses/cheque_status.rb', line 17 def processing_error? !error_code.nil? end |