rats 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,594 @@
1
+ module Rats
2
+ class Base
3
+
4
+ # this array doesn't define what is valid, but trys to define what
5
+ # combinations of meridian/range/township/section exist
6
+ #
7
+
8
+ # format
9
+ # VALID_MERIDIAN => {
10
+ # # NOTE: any RANGE not listed here, does not exist
11
+ # # NOTE: any TOWNSHIP not within the VALID_TOWNSHIP_RANGE does not exist
12
+ # RANGE => { :townships => VALID_TOWNSHIP_RANGE,
13
+ # :sections => {
14
+ # # NOTE: a TOWNSHIP not included here means all sections are valid within
15
+ # # NOTE: for a TOWNSHIP listed here, only a SECTION within
16
+ # # ARRAY_OF_VALID_SECTIONS is valid
17
+ # VALID_TOWNSHIP => ARRAY_OF_VALID_SECTIONS
18
+ # }
19
+ # }
20
+ # }
21
+
22
+ TOWNSHIPS_BY_RANGE_AND_MERIDIAN = {
23
+ 4 => {
24
+ 1 => { :townships => 1..126 },
25
+ 2 => { :townships => 1..126 },
26
+ 3 => { :townships => 1..126 },
27
+ 4 => { :townships => 1..126 },
28
+ 5 => { :townships => 1..126 },
29
+ 6 => { :townships => 1..126 },
30
+ 7 => { :townships => 1..126 },
31
+ 8 => { :townships => 1..126 },
32
+ 9 => { :townships => 1..126 },
33
+ 10 => { :townships => 1..126 },
34
+ 11 => { :townships => 1..126 },
35
+ 12 => { :townships => 1..126 },
36
+ 13 => { :townships => 1..126 },
37
+ 14 => { :townships => 1..126 },
38
+ 15 => { :townships => 1..126 },
39
+ 16 => { :townships => 1..126 },
40
+ 17 => { :townships => 1..126 },
41
+ 18 => { :townships => 1..126 },
42
+ 19 => { :townships => 1..126 },
43
+ 20 => { :townships => 1..126 },
44
+ 21 => { :townships => 1..126,
45
+ :sections => {
46
+ 3 => [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,22,23,24,25,26,27,28,31,32,33,34,35,36],
47
+ }
48
+ },
49
+ 22 => { :townships => 1..126 },
50
+ 23 => { :townships => 1..126 },
51
+ 24 => { :townships => 1..122,
52
+ :sections => {
53
+ 111 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
54
+ 112 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
55
+ 113 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
56
+ 114 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
57
+ 115 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
58
+ 116 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
59
+ 117 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
60
+ 118 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
61
+ 119 => [1,12,13,24,25,36],
62
+ 120 => [1,12,13,23,24,25,26,35,36],
63
+ 121 => [1,2,11,12,13,14,23,24,25,26,35,36],
64
+ 122 => [1,2,11,12,13,14,23,24,25,26,35,36],
65
+ }
66
+ },
67
+ 25 => { :townships => 1..106,
68
+ :sections => {
69
+ 91 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
70
+ 92 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
71
+ 93 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
72
+ 94 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
73
+ 95 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
74
+ 96 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
75
+ 97 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
76
+ 98 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
77
+ 99 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
78
+ 100 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
79
+ 101 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
80
+ 102 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
81
+ 103 => [1,12,13,24,25,36],
82
+ 104 => [1,12,13,24,25,36],
83
+ 105 => [1,12,13,24,25,36],
84
+ 106 => [1,12,13,24,25,36],
85
+ }
86
+ },
87
+ 26 => { :townships => 1..90,
88
+ :sections => {
89
+ 75 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
90
+ 76 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
91
+ 77 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
92
+ 78 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
93
+ 79 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
94
+ 80 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
95
+ 81 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
96
+ 82 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
97
+ 83 => [1,2,11,12,13,14,23,24,25,26,35,36],
98
+ 84 => [1,2,11,12,13,14,23,24,25,26,35,36],
99
+ 85 => [1,2,11,12,13,14,23,24,25,26,35,36],
100
+ 86 => [1,2,11,12,13,14,23,24,25,26,35,36],
101
+ 87 => [1,12,13,24,25,36],
102
+ 88 => [1,12,13,24,25,36],
103
+ 89 => [1,12,13,24,25,36],
104
+ 90 => [1,12,13,24,25,36],
105
+ }
106
+ },
107
+ 27 => { :townships => 1..70,
108
+ :sections => {
109
+ 59 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
110
+ 60 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
111
+ 61 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
112
+ 62 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
113
+ 63 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
114
+ 64 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
115
+ 65 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
116
+ 66 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
117
+ 67 => [1,2,11,12,13,14,23,24,25,26,35,36],
118
+ 68 => [1,2,11,12,13,14,23,24,25,26,35,36],
119
+ 69 => [1,2,11,12,13,14,23,24,25,26,35,36],
120
+ 70 => [1,2,11,12,13,14,23,24,25,26,35,36],
121
+ }
122
+ },
123
+ 28 => { :townships => 1..54,
124
+ :sections => {
125
+ 39 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
126
+ 40 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
127
+ 41 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
128
+ 42 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
129
+ 43 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
130
+ 44 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
131
+ 45 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
132
+ 46 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
133
+ 47 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
134
+ 48 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
135
+ 49 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
136
+ 50 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
137
+ 51 => [1,12,13,24,25,36],
138
+ 52 => [1,12,13,24,25,36],
139
+ 53 => [1,12,13,24,25,36],
140
+ 54 => [1,12,13,24,25,36],
141
+ }
142
+ },
143
+ 29 => { :townships => 1..34,
144
+ :sections => {
145
+ 23 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
146
+ 24 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
147
+ 25 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
148
+ 26 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
149
+ 27 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
150
+ 28 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
151
+ 29 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
152
+ 30 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
153
+ 31 => [1,2,11,12,13,14,23,24,25,26,35,36],
154
+ 32 => [1,2,11,12,13,14,23,24,25,26,35,36],
155
+ 33 => [1,2,11,12,13,14,23,24,25,26,35,36],
156
+ 34 => [1,2,11,12,13,14,23,24,25,26,35,36],
157
+ }
158
+ },
159
+ 30 => { :townships => 1..18,
160
+ :sections => {
161
+ 3 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
162
+ 4 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
163
+ 5 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
164
+ 6 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
165
+ 7 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
166
+ 8 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
167
+ 9 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
168
+ 10 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
169
+ 11 => [1,2,11,12,13,14,23,24,25,26,35,36],
170
+ 12 => [1,2,11,12,13,14,23,24,25,26,35,36],
171
+ 13 => [1,2,11,12,13,14,23,24,25,26,35,36],
172
+ 14 => [1,2,11,12,13,14,23,24,25,26,35,36],
173
+ 15 => [1,12,13,24,25,36],
174
+ 16 => [1,12,13,24,25,36],
175
+ 17 => [1,12,13,24,25,36],
176
+ 18 => [1,12,13,24,25,36],
177
+ }
178
+ },
179
+ },
180
+ 5 => {
181
+ 1 => { :townships => 1..126 },
182
+ 2 => { :townships => 1..126 },
183
+ 3 => { :townships => 1..126 },
184
+ 4 => { :townships => 1..126 },
185
+ 5 => { :townships => 1..126,
186
+ :sections => {
187
+ 1 => [1,2,12,13,24,25,36],
188
+ 2 => [1,12,13,24,25,36],
189
+ 3 => [1,12,13,24,25,36],
190
+ 4 => [1,12,13,24,25,31,32,33,34,35,36],
191
+ }
192
+ },
193
+ 6 => { :townships => 4..126,
194
+ :sections => {
195
+ 4 => [36],
196
+ 5 => [1,12,13,24,25,36],
197
+ 6 => [1,12,13,24,25,36],
198
+ }
199
+ },
200
+ 7 => { :townships => 7..126,
201
+ :sections => {
202
+ 7 => [1,12,13,24,25,36],
203
+ 8 => [1,12,13,24,25,36],
204
+ 9 => [1,12,13,24,25,36],
205
+ 10 => [1,12,13,24,25,36],
206
+ 11 => [1,12,13,24,25,36],
207
+ 12 => [1,12,13,24,25,31,32,33,34,35,36],
208
+ }
209
+ },
210
+ 8 => { :townships => 12..126,
211
+ :sections => {
212
+ 12 => [36],
213
+ 13 => [1,12,13,24,25,36],
214
+ 14 => [1,12,13,24,25,36],
215
+ 15 => [1,12,13,24,25,36],
216
+ 16 => [1,12,13,24,25,31,32,33,34,35,36],
217
+ }
218
+ },
219
+ 9 => { :townships => 16..126,
220
+ :sections => {
221
+ 16 => [31,32,33,34,35,36],
222
+ }
223
+ },
224
+ 10 => { :townships => 16..126,
225
+ :sections => {
226
+ 16 => [31,32,33,34,35,36],
227
+ }
228
+ },
229
+ 11 => { :townships => 16..126,
230
+ :sections => {
231
+ 16 => [31,32,33,34,35,36],
232
+ }
233
+ },
234
+ 12 => { :townships => 16..126,
235
+ :sections => {
236
+ 16 => [36],
237
+ 17 => [1,12,13,24,25,36],
238
+ 18 => [1,12,13,24,25,36],
239
+ 19 => [1,12,13,24,25,36],
240
+ 20 => [1,12,13,24,25,31,32,33,34,35,36],
241
+ }
242
+ },
243
+ 13 => { :townships => 20..126,
244
+ :sections => {
245
+ 20 => [31,32,33,34,35,36],
246
+ }
247
+ },
248
+ 14 => { :townships => 20..126,
249
+ :sections => {
250
+ 20 => [31,32,33,34,35,36],
251
+ }
252
+ },
253
+ 15 => { :townships => 20..126,
254
+ :sections => {
255
+ 20 => [36],
256
+ 21 => [1,12,13,24,25,36],
257
+ 22 => [1,12,13,24,25,36],
258
+ 23 => [1,12,13,24,25,36],
259
+ 24 => [1,12,13,24,25,31,32,33,34,35,36],
260
+ }
261
+ },
262
+ 16 => { :townships => 24..126,
263
+ :sections => {
264
+ 24 => [31,32,33,34,35,36],
265
+ }
266
+ },
267
+ 17 => { :townships => 24..126,
268
+ :sections => {
269
+ 24 => [31,32,33,34,35,36],
270
+ }
271
+ },
272
+ 18 => { :townships => 24..126,
273
+ :sections => {
274
+ 24 => [36],
275
+ 25 => [1,12,13,24,25,36],
276
+ 26 => [1,12,13,24,25,36],
277
+ 27 => [1,12,13,24,25,36],
278
+ 28 => [1,12,13,24,25,31,32,33,34,35,36],
279
+ }
280
+ },
281
+ 19 => { :townships => 28..126,
282
+ :sections => {
283
+ 28 => [31,32,33,34,35,36],
284
+ }
285
+ },
286
+ 20 => { :townships => 28..126,
287
+ :sections => {
288
+ 28 => [31,32,33,34,35,36],
289
+ }
290
+ },
291
+ 21 => { :townships => 28..126,
292
+ :sections => {
293
+ 28 => [31,32,33,34,35,36],
294
+ }
295
+ },
296
+ 22 => { :townships => 28..126,
297
+ :sections => {
298
+ 28 => [36],
299
+ 29 => [1,12,13,24,25,36],
300
+ 30 => [1,12,13,24,25,36],
301
+ 31 => [1,12,13,24,25,31,32,33,34,35,36],
302
+ }
303
+ },
304
+ 23 => { :townships => 31..126,
305
+ :sections => {
306
+ 31 => [36],
307
+ 32 => [1,12,13,24,25,31,32,33,34,35,36],
308
+ }
309
+ },
310
+ 24 => { :townships => 32..122,
311
+ :sections => {
312
+ 32 => [31,32,33,34,35,36],
313
+ 111 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
314
+ 112 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
315
+ 113 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
316
+ 114 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
317
+ 115 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
318
+ 116 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
319
+ 117 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
320
+ 118 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
321
+ 119 => [1,2,11,12,13,14,23,24,25,26,35,36],
322
+ 120 => [1,2,11,12,13,14,23,24,25,26,35,36],
323
+ 121 => [1,2,11,12,13,14,23,24,25,26,35,36],
324
+ 122 => [1,2,11,12,13,14,23,24,25,26,35,36],
325
+ }
326
+ },
327
+ 25 => { :townships => 32..106,
328
+ :sections => {
329
+ 32 => [31,32,33,34,35,36],
330
+ 91 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
331
+ 92 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
332
+ 93 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
333
+ 94 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
334
+ 95 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
335
+ 96 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
336
+ 97 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
337
+ 98 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
338
+ 99 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
339
+ 100 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
340
+ 101 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
341
+ 102 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
342
+ 103 => [1,12,13,24,25,36],
343
+ 104 => [1,12,13,24,25,36],
344
+ 105 => [1,12,13,24,25,36],
345
+ 106 => [1,12,13,24,25,36],
346
+ }
347
+ },
348
+ 26 => { :townships => 32..90,
349
+ :sections => {
350
+ 32 => [31,32,33,34,35,36],
351
+ 75 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
352
+ 76 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
353
+ 77 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
354
+ 78 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
355
+ 79 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
356
+ 80 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
357
+ 81 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
358
+ 82 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
359
+ 83 => [1,2,11,12,13,14,23,24,25,26,35,36],
360
+ 84 => [1,2,11,12,13,14,23,24,25,26,35,36],
361
+ 85 => [1,2,11,12,13,14,23,24,25,26,35,36],
362
+ 86 => [1,2,11,12,13,14,23,24,25,26,35,36],
363
+ 87 => [1,12,13,24,25,36],
364
+ 88 => [1,12,13,24,25,36],
365
+ 89 => [1,12,13,24,25,36],
366
+ 90 => [1,12,13,24,25,36],
367
+ }
368
+ },
369
+ 27 => { :townships => 32..70,
370
+ :sections => {
371
+ 32 => [31,32,33,34,35,36],
372
+ 59 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
373
+ 60 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
374
+ 61 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
375
+ 62 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
376
+ 63 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
377
+ 64 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
378
+ 65 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
379
+ 66 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
380
+ 67 => [1,2,11,12,13,14,23,24,25,26,35,36],
381
+ 68 => [1,2,11,12,13,14,23,24,25,26,35,36],
382
+ 69 => [1,2,11,12,13,14,23,24,25,26,35,36],
383
+ 70 => [1,2,11,12,13,14,23,24,25,26,35,36],
384
+ }
385
+ },
386
+ 28 => { :townships => 32..54,
387
+ :sections => {
388
+ 32 => [31,32,33,34,35,36],
389
+ 39 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
390
+ 40 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
391
+ 41 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
392
+ 42 => [1,2,3,4,5,8,9,10,11,12,13,14,15,16,17,20,21,22,23,24,25,26,27,28,29,32,33,34,35,36],
393
+ 43 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
394
+ 44 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
395
+ 45 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
396
+ 46 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
397
+ 47 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
398
+ 48 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
399
+ 49 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
400
+ 50 => [1,2,3,10,11,12,13,14,15,22,23,24,25,26,27,34,35,36],
401
+ 51 => [1,12,13,24,25,36],
402
+ 52 => [1,12,13,24,25,36],
403
+ 53 => [1,12,13,24,25,36],
404
+ 54 => [1,12,13,24,25,36],
405
+ }
406
+ },
407
+ 29 => { :townships => 32..38,
408
+ :sections => {
409
+ 32 => [36],
410
+ 33 => [1,12,13,24,25,36],
411
+ 34 => [1,12,13,24,25,36],
412
+ 35 => [1,12,13,24,25,36],
413
+ 36 => [1,12,13,24,25,36],
414
+ 37 => [1,12,13,24,25,36],
415
+ 38 => [1,12,13,24,25,36],
416
+ }
417
+ },
418
+ },
419
+ 6 => {
420
+ 1 => { :townships => 35..126,
421
+ :sections => {
422
+ 35 => [1,12,13,24,25,36],
423
+ 36 => [1,12,13,24,25,31,32,33,34,35,36],
424
+ }
425
+ },
426
+ 2 => { :townships => 36..126,
427
+ :sections => {
428
+ 36 => [31,32,33,34,35,36],
429
+ }
430
+ },
431
+ 3 => { :townships => 36..126,
432
+ :sections => {
433
+ 36 => [36],
434
+ 37 => [1,12,13,24,25,36],
435
+ 38 => [1,12,13,24,25,36],
436
+ 39 => [1,12,13,24,25,36],
437
+ 40 => [1,12,13,24,25,31,32,33,34,35,36],
438
+ }
439
+ },
440
+ 4 => { :townships => 40..126,
441
+ :sections => {
442
+ 40 => [31,32,33,34,35,36],
443
+ }
444
+ },
445
+ 5 => { :townships => 40..126,
446
+ :sections => {
447
+ 40 => [36],
448
+ 41 => [1,12,13,24,25,36],
449
+ 42 => [1,12,13,24,25,36],
450
+ 43 => [1,12,13,24,25,36],
451
+ 44 => [1,12,13,24,25,31,32,33,34,35,36],
452
+ }
453
+ },
454
+ 6 => { :townships => 44..126,
455
+ :sections => {
456
+ 44 => [31,32,33,34,35,36],
457
+ }
458
+ },
459
+ 7 => { :townships => 44..126,
460
+ :sections => {
461
+ 44 => [31,32,33,34,35,36],
462
+ }
463
+ },
464
+ 8 => { :townships => 44..126,
465
+ :sections => {
466
+ 44 => [31,32,33,34,35,36],
467
+ }
468
+ },
469
+ 9 => { :townships => 44..126,
470
+ :sections => {
471
+ 44 => [31,32,33,34,35,36],
472
+ }
473
+ },
474
+ 10 => { :townships => 44..126,
475
+ :sections => {
476
+ 44 => [36],
477
+ 45 => [1,12,13,24,25,36],
478
+ 46 => [1,12,13,24,25,36],
479
+ 47 => [1,12,13,24,25,36],
480
+ 48 => [1,12,13,24,25,31,32,33,34,35,36],
481
+ }
482
+ },
483
+ 11 => { :townships => 48..126,
484
+ :sections => {
485
+ 48 => [31,32,33,34,35,36],
486
+ }
487
+ },
488
+ 12 => { :townships => 48..126,
489
+ :sections => {
490
+ 48 => [31,32,33,34,35,36],
491
+ }
492
+ },
493
+ 13 => { :townships => 48..126,
494
+ :sections => {
495
+ 48 => [31,32,33,34,35,36],
496
+ 115 => [1,12,13,24,25,36],
497
+ 116 => [1,12,13,24,25,36],
498
+ 117 => [1,12,13,24,25,36],
499
+ 118 => [1,12,13,24,25,36],
500
+ 119 => [1,12,13,24,25,36],
501
+ 120 => [1,12,13,24,25,36],
502
+ 121 => [1,12,13,24,25,36],
503
+ 122 => [1,12,13,24,25,36],
504
+ 123 => [1,12,13,24,25,36],
505
+ 124 => [1,12,13,24,25,36],
506
+ 125 => [1,12,13,24,25,36],
507
+ 126 => [1,12,13,24,25,36],
508
+ }
509
+ },
510
+ 14 => { :townships => 48..114,
511
+ :sections => {
512
+ 48 => [31,32,33,34,35,36],
513
+ 75 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
514
+ 76 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
515
+ 77 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
516
+ 78 => [1,2,3,4,9,10,11,12,13,14,15,16,21,22,23,24,25,26,27,28,33,34,35,36],
517
+ 79 => [1,12,13,24,25,36],
518
+ 80 => [1,12,13,24,25,36],
519
+ 81 => [1,12,13,24,25,36],
520
+ 82 => [1,12,13,24,25,36],
521
+ 83 => [1,12,13,24,25,36],
522
+ 84 => [1,12,13,24,25,36],
523
+ 85 => [1,12,13,24,25,36],
524
+ 86 => [1,12,13,24,25,36],
525
+ 87 => [1,12,13,24,25,36],
526
+ 88 => [1,12,13,24,25,36],
527
+ 89 => [1,12,13,24,25,36],
528
+ 90 => [1,12,13,24,25,36],
529
+ 91 => [1,12,13,24,25,36],
530
+ 92 => [1,12,13,24,25,36],
531
+ 93 => [1,12,13,24,25,36],
532
+ 94 => [1,12,13,24,25,36],
533
+ 95 => [1,12,13,24,25,36],
534
+ 96 => [1,12,13,24,25,36],
535
+ 97 => [1,12,13,24,25,36],
536
+ 98 => [1,12,13,24,25,36],
537
+ 99 => [1,12,13,24,25,36],
538
+ 100 => [1,12,13,24,25,36],
539
+ 101 => [1,12,13,24,25,36],
540
+ 102 => [1,12,13,24,25,36],
541
+ 103 => [1,12,13,24,25,36],
542
+ 104 => [1,12,13,24,25,36],
543
+ 105 => [1,12,13,24,25,36],
544
+ 106 => [1,12,13,24,25,36],
545
+ 107 => [1,12,13,24,25,36],
546
+ 108 => [1,12,13,24,25,36],
547
+ 109 => [1,12,13,24,25,36],
548
+ 110 => [1,12,13,24,25,36],
549
+ 111 => [1,12,13,24,25,36],
550
+ 112 => [1,12,13,24,25,36],
551
+ 113 => [1,12,13,24,25,36],
552
+ 114 => [1,12,13,24,25,36],
553
+ }
554
+ },
555
+ 15 => { :townships => 48..78,
556
+ :sections => {
557
+ 48 => [36],
558
+ 49 => [1,12,13,24,25,36],
559
+ 50 => [1,12,13,24,25,36],
560
+ 51 => [1,12,13,24,25,36],
561
+ 52 => [1,12,13,24,25,36],
562
+ 53 => [1,12,13,24,25,36],
563
+ 54 => [1,12,13,24,25,36],
564
+ 55 => [1,12,13,24,25,36],
565
+ 56 => [1,12,13,24,25,36],
566
+ 57 => [1,12,13,24,25,36],
567
+ 58 => [1,12,13,24,25,36],
568
+ 59 => [1,12,13,24,25,36],
569
+ 60 => [1,12,13,24,25,36],
570
+ 61 => [1,12,13,24,25,36],
571
+ 62 => [1,12,13,24,25,36],
572
+ 63 => [1,12,13,24,25,36],
573
+ 64 => [1,12,13,24,25,36],
574
+ 65 => [1,12,13,24,25,36],
575
+ 66 => [1,12,13,24,25,36],
576
+ 67 => [1,12,13,24,25,36],
577
+ 68 => [1,12,13,24,25,36],
578
+ 69 => [1,12,13,24,25,36],
579
+ 70 => [1,12,13,24,25,36],
580
+ 71 => [1,12,13,24,25,36],
581
+ 72 => [1,12,13,24,25,36],
582
+ 73 => [1,12,13,24,25,36],
583
+ 74 => [1,12,13,24,25,36],
584
+ 75 => [1,36],
585
+ 76 => [36],
586
+ 77 => [36],
587
+ 78 => [36],
588
+ }
589
+ },
590
+ }
591
+ }
592
+
593
+ end
594
+ end
@@ -0,0 +1,89 @@
1
+ module Rats
2
+ class Data
3
+
4
+ attr_accessor :value
5
+
6
+ def initialize(value=nil)
7
+ self.value = value
8
+ end
9
+
10
+ def nil!; @value = nil; end
11
+
12
+ #
13
+ # READ & WRITE
14
+ #
15
+
16
+ def value=(value)
17
+ return unless value
18
+ @value = self.class.transform(value)
19
+ raise ArgumentError unless self.valid?
20
+ end
21
+ alias v= value=
22
+ alias v value
23
+
24
+ # optional: override this in a sub-class
25
+ #
26
+ def self.transform(value); value; end
27
+
28
+ #
29
+ # DISPLAY
30
+ #
31
+
32
+ def to_s
33
+ return nil unless @value
34
+ self.value.to_s
35
+ end
36
+
37
+ # it is expected that a specfic data sub-class will re-define this
38
+ #
39
+ def self.padding_width; 1; end
40
+ def self.padding_value; " "; end
41
+
42
+ def to_p
43
+ return nil unless @value
44
+ self.value.to_s.rjust(self.class.padding_width,self.class.padding_value)
45
+ end
46
+
47
+ #
48
+ # TRAVERSING
49
+ #
50
+ # - it is expected that a specfic data sub-class will define this
51
+ #
52
+
53
+ def up; traverse(:up); end
54
+ def up!; traverse!(:up); end
55
+ alias north up
56
+ alias north! up!
57
+
58
+ def right; traverse(:right); end
59
+ def right!; traverse!(:right); end
60
+ alias east right
61
+ alias east! right!
62
+
63
+ def down; traverse(:down); end
64
+ def down!; traverse!(:down); end
65
+ alias south down
66
+ alias south! down!
67
+
68
+ def left; traverse(:left); end
69
+ def left!; traverse!(:left); end
70
+ alias west left
71
+ alias west! left!
72
+
73
+ #
74
+ # VALIDATION
75
+ #
76
+ # - it is expected that a specfic data sub-class will re-define this
77
+ #
78
+
79
+ def valid?
80
+ true
81
+ end
82
+
83
+ private
84
+
85
+ def traverse(direction); raise NotImplementedError; end
86
+ def traverse!(direction); raise NotImplementedError; end
87
+
88
+ end
89
+ end