Class: CTAPI::Response
Overview
A response received from the cardterminal.
Instance Attribute Summary
Attributes inherited from APDU
Instance Method Summary collapse
- #changed? ⇒ Boolean
- #not_changed? ⇒ Boolean
-
#successful? ⇒ Boolean
If this response was successful true is returned, false otherwise.
Methods inherited from APDU
#[], #initialize, #inspect, #to_s
Constructor Details
This class inherits a constructor from CTAPI::APDU
Instance Method Details
#changed? ⇒ Boolean
445 446 447 |
# File 'lib/ctapi.rb', line 445 def changed? @data[-2, 2] == "\x62\x00" ? true : false end |
#not_changed? ⇒ Boolean
449 450 451 |
# File 'lib/ctapi.rb', line 449 def not_changed? @data[-2, 2] == "\x62\x01" ? true : false end |
#successful? ⇒ Boolean
If this response was successful true is returned, false otherwise. A response is successful if the last two bytes are ‘90:00’.
439 440 441 442 443 |
# File 'lib/ctapi.rb', line 439 def successful? return false if @data.size < 2 return true if @data[-2, 2] == "\x90\x00" false end |