Class: Bakong::Khqr::MerchantCode::PayloadFormatIndicator

Inherits:
TagLengthString
  • Object
show all
Defined in:
lib/bakong/khqr/merchant_code/payload_format_indicator.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) ⇒ PayloadFormatIndicator

Returns a new instance of PayloadFormatIndicator.



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

def initialize(tag, value)
  raise Error.from(ERROR_CODES[:PAYLOAD_FORMAT_INDICATOR_TAG_REQUIRED]) if value.nil? || value == ""
  raise Error.from(ERROR_CODES[:PAYLOAD_FORMAT_INDICATOR_LENGTH_INVALID]) if value.length > 2

  super
end