Class: Bakong::Khqr::MerchantCode::CRC
- Inherits:
-
TagLengthString
- Object
- TagLengthString
- Bakong::Khqr::MerchantCode::CRC
- Defined in:
- lib/bakong/khqr/merchant_code/crc.rb
Instance Attribute Summary
Attributes inherited from TagLengthString
Instance Method Summary collapse
-
#initialize(tag, value) ⇒ CRC
constructor
A new instance of CRC.
Methods inherited from TagLengthString
Constructor Details
#initialize(tag, value) ⇒ CRC
Returns a new instance of CRC.
11 12 13 14 15 16 |
# File 'lib/bakong/khqr/merchant_code/crc.rb', line 11 def initialize(tag, value) raise Error.from(ERROR_CODES[:CRC_TAG_REQUIRED]) if value.nil? || value == "" raise Error.from(ERROR_CODES[:CRC_LENGTH_INVALID]) if value.length > 4 super end |