Class: Bakong::Khqr::MerchantCode::BakongAccountID
- Inherits:
-
TagLengthString
- Object
- TagLengthString
- Bakong::Khqr::MerchantCode::BakongAccountID
- Defined in:
- lib/bakong/khqr/merchant_code/global_unique_identifier.rb
Instance Attribute Summary
Attributes inherited from TagLengthString
Instance Method Summary collapse
-
#initialize(tag, bakong_account_id) ⇒ BakongAccountID
constructor
A new instance of BakongAccountID.
Methods inherited from TagLengthString
Constructor Details
#initialize(tag, bakong_account_id) ⇒ BakongAccountID
Returns a new instance of BakongAccountID.
68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/bakong/khqr/merchant_code/global_unique_identifier.rb', line 68 def initialize(tag, bakong_account_id) raise Error.from(ERROR_CODES[:BAKONG_ACCOUNT_ID_REQUIRED]) if bakong_account_id.nil? || bakong_account_id == "" parts = bakong_account_id.split("@") if bakong_account_id.length > EMV[:INVALID_LENGTH][:BAKONG_ACCOUNT] raise Error.from(ERROR_CODES[:BAKONG_ACCOUNT_ID_LENGTH_INVALID]) end raise Error.from(ERROR_CODES[:BAKONG_ACCOUNT_ID_INVALID]) if parts.length < 2 super end |