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