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