Class: Bakong::Khqr::MerchantCode::MerchantCity

Inherits:
TagLengthString show all
Defined in:
lib/bakong/khqr/merchant_code/merchant_city.rb

Instance Attribute Summary

Attributes inherited from TagLengthString

#length, #tag, #value

Instance Method Summary collapse

Methods inherited from TagLengthString

#to_s

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