Class: Bakong::Khqr::MerchantCode::MerchantName

Inherits:
TagLengthString show all
Defined in:
lib/bakong/khqr/merchant_code/merchant_name.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) ⇒ MerchantName

Returns a new instance of MerchantName.



12
13
14
15
16
17
# File 'lib/bakong/khqr/merchant_code/merchant_name.rb', line 12

def initialize(tag, value)
  raise Error.from(ERROR_CODES[:MERCHANT_NAME_REQUIRED]) if value.nil? || value == ""
  raise Error.from(ERROR_CODES[:MERCHANT_NAME_LENGTH_INVALID]) if value.length > EMV[:INVALID_LENGTH][:MERCHANT_NAME]

  super
end