@@ -57,63 +57,75 @@ module ISO8583
5757 }
5858
5959 LL_BCD = BCDField . new
60+ LL_BCD . name = "LL_BCD"
6061 LL_BCD . length = 2
6162 LL_BCD . codec = Packed_Number
6263
6364 # Two byte variable length ASCII numeral, payload ASCII numerals
6465 LLVAR_N = Field . new
66+ LLVAR_N . name = "LLVAR_N"
6567 LLVAR_N . length = LL
6668 LLVAR_N . codec = ASCII_Number
6769
6870 # Three byte variable length ASCII numeral, payload ASCII numerals
6971 LLLVAR_N = Field . new
72+ LLLVAR_N . name = "LLLVAR_N"
7073 LLLVAR_N . length = LLL
7174 LLLVAR_N . codec = ASCII_Number
7275
7376 # Two byte variable length ASCII numeral, payload Track2 data
7477 LLVAR_Z = Field . new
78+ LLVAR_Z . name = "LLVAR_Z"
7579 LLVAR_Z . length = LL
7680 LLVAR_Z . codec = Track2
7781
7882 # Two byte variable length ASCII numeral, payload ASCII, fixed length, zeropadded (right)
7983 LLVAR_AN = Field . new
84+ LLVAR_AN . name = "LLVAR_AN"
8085 LLVAR_AN . length = LL
8186 LLVAR_AN . codec = AN_Codec
8287
8388 # Two byte variable length ASCII numeral, payload ASCII+special
8489 LLVAR_ANS = Field . new
90+ LLVAR_ANS . name = "LLVAR_ANS"
8591 LLVAR_ANS . length = LL
8692 LLVAR_ANS . codec = ANS_Codec
8793
8894 # Three byte variable length ASCII numeral, payload ASCII, fixed length, zeropadded (right)
8995 LLLVAR_AN = Field . new
96+ LLLVAR_AN . name = "LLLVAR_AN"
9097 LLLVAR_AN . length = LLL
9198 LLLVAR_AN . codec = AN_Codec
9299
93100 # Three byte variable length ASCII numeral, payload ASCII+special
94101 LLLVAR_ANS = Field . new
102+ LLLVAR_ANS . name = "LLLVAR_ANS"
95103 LLLVAR_ANS . length = LLL
96104 LLLVAR_ANS . codec = ANS_Codec
97105
98106 # Two byte variable length binary payload
99107 LLVAR_B = Field . new
108+ LLVAR_B . name = "LLVAR_B"
100109 LLVAR_B . length = LL
101110 LLVAR_B . codec = Null_Codec
102111
103112
104113 # Three byte variable length binary payload
105114 LLLVAR_B = Field . new
115+ LLLVAR_B . name = "LLLVAR_B"
106116 LLLVAR_B . length = LLL
107117 LLLVAR_B . codec = Null_Codec
108118
109119 # Fixed lengh numerals, repesented in ASCII, padding right justified using zeros
110120 N = Field . new
121+ N . name = "N"
111122 N . codec = ASCII_Number
112123 N . padding = lambda { |val , len |
113124 sprintf ( "%0#{ len } d" , val )
114125 }
115126
116127 N_BCD = BCDField . new
128+ N_BCD . name = "N_BCD"
117129 N_BCD . codec = Packed_Number
118130
119131 PADDING_LEFT_JUSTIFIED_SPACES = lambda { |val , len |
@@ -122,25 +134,30 @@ module ISO8583
122134
123135 # Fixed length ASCII letters [A-Za-z]
124136 A = Field . new
137+ A . name = "A"
125138 A . codec = A_Codec
126139
127140 # Fixed lengh ASCII [A-Za-z0-9], padding left justified using spaces.
128141 AN = Field . new
142+ AN . name = "AN"
129143 AN . codec = AN_Codec
130144 AN . padding = PADDING_LEFT_JUSTIFIED_SPACES
131145
132146 # Fixed lengh ASCII [A-Za-z0-9] and space, padding left, spaces
133147 ANP = Field . new
148+ ANP . name = "ANP"
134149 ANP . codec = ANP_Codec
135150 ANP . padding = PADDING_LEFT_JUSTIFIED_SPACES
136151
137152 # Fixed length ASCII [\x20-\x7E], padding left, spaces
138153 ANS = Field . new
154+ ANS . name = ANS
139155 ANS . codec = ANS_Codec
140156 ANS . padding = PADDING_LEFT_JUSTIFIED_SPACES
141157
142158 # Binary data, padding left using nulls (0x00)
143159 B = Field . new
160+ B . name = "B"
144161 B . codec = Null_Codec
145162 B . padding = lambda { |val , len |
146163 while val . length < len
@@ -151,24 +168,29 @@ module ISO8583
151168
152169 # Date, formatted as described in ASCII numerals
153170 MMDDhhmmss = Field . new
171+ MMDDhhmmss . name = "MMDDhhmmss"
154172 MMDDhhmmss . codec = MMDDhhmmssCodec
155173 MMDDhhmmss . length = 10
156174
157175 #Date, formatted as described in ASCII numerals
158176 YYMMDDhhmmss = Field . new
177+ YYMMDDhhmmss . name = "YYMMDDhhmmss"
159178 YYMMDDhhmmss . codec = YYMMDDhhmmssCodec
160179 YYMMDDhhmmss . length = 12
161180
162181 #Date, formatted as described in ASCII numerals
163182 YYMM = Field . new
183+ YYMM . name = "YYMM"
164184 YYMM . codec = YYMMCodec
165185 YYMM . length = 4
166186
167187 MMDD = Field . new
188+ MMDD . name = "MMDD"
168189 MMDD . codec = MMDDCodec
169190 MMDD . length = 4
170191
171192 Hhmmss = Field . new
193+ Hhmmss . name = "Hhmmss"
172194 Hhmmss . codec = HhmmssCodec
173195 Hhmmss . length = 6
174196
0 commit comments