code-ruby 3.1.2 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/code +100 -20
- data/lib/code/concerns/shared.rb +335 -15
- data/lib/code/format.rb +33 -15
- data/lib/code/network.rb +82 -0
- data/lib/code/node/call.rb +80 -2
- data/lib/code/node/call_argument.rb +14 -0
- data/lib/code/node/code.rb +4 -3
- data/lib/code/node/function_parameter.rb +7 -4
- data/lib/code/node/list.rb +32 -2
- data/lib/code/node/square_bracket.rb +4 -2
- data/lib/code/object/base_64.rb +132 -6
- data/lib/code/object/boolean.rb +56 -0
- data/lib/code/object/class.rb +143 -2
- data/lib/code/object/code.rb +108 -7
- data/lib/code/object/context.rb +59 -1
- data/lib/code/object/cryptography.rb +69 -0
- data/lib/code/object/date.rb +13800 -462
- data/lib/code/object/decimal.rb +1098 -0
- data/lib/code/object/dictionary.rb +1861 -11
- data/lib/code/object/duration.rb +24 -0
- data/lib/code/object/function.rb +289 -27
- data/lib/code/object/global.rb +447 -1
- data/lib/code/object/html.rb +181 -7
- data/lib/code/object/http.rb +253 -17
- data/lib/code/object/ics.rb +76 -13
- data/lib/code/object/identifier_list.rb +30 -10
- data/lib/code/object/integer.rb +1265 -2
- data/lib/code/object/json.rb +80 -1
- data/lib/code/object/list.rb +3371 -10
- data/lib/code/object/nothing.rb +53 -0
- data/lib/code/object/number.rb +120 -0
- data/lib/code/object/parameter.rb +149 -0
- data/lib/code/object/range.rb +530 -14
- data/lib/code/object/smtp.rb +103 -12
- data/lib/code/object/string.rb +968 -3
- data/lib/code/object/super.rb +11 -1
- data/lib/code/object/time.rb +13932 -498
- data/lib/code/object/url.rb +67 -0
- data/lib/code/object.rb +582 -0
- data/lib/code/parser.rb +194 -55
- data/lib/code-ruby.rb +3 -0
- data/lib/code.rb +30 -3
- metadata +135 -84
- data/.github/dependabot.yml +0 -15
- data/.github/workflows/ci.yml +0 -38
- data/.gitignore +0 -30
- data/.node-version +0 -1
- data/.npm-version +0 -1
- data/.prettierignore +0 -2
- data/.rspec +0 -1
- data/.rubocop.yml +0 -140
- data/.ruby-version +0 -1
- data/.tool-versions +0 -3
- data/AGENTS.md +0 -43
- data/Gemfile +0 -22
- data/Gemfile.lock +0 -292
- data/Rakefile +0 -5
- data/bin/bundle +0 -123
- data/bin/bundle-audit +0 -31
- data/bin/bundler-audit +0 -31
- data/bin/dorian +0 -31
- data/bin/rspec +0 -31
- data/bin/rubocop +0 -31
- data/bin/test +0 -5
- data/code-ruby.gemspec +0 -34
- data/docs/precedence.txt +0 -36
- data/package-lock.json +0 -14
- data/package.json +0 -7
- data/spec/bin/code_spec.rb +0 -48
- data/spec/code/format_spec.rb +0 -153
- data/spec/code/node/call_spec.rb +0 -11
- data/spec/code/object/boolean_spec.rb +0 -18
- data/spec/code/object/cryptography_spec.rb +0 -25
- data/spec/code/object/decimal_spec.rb +0 -50
- data/spec/code/object/dictionary_spec.rb +0 -98
- data/spec/code/object/function_spec.rb +0 -268
- data/spec/code/object/http_spec.rb +0 -33
- data/spec/code/object/ics_spec.rb +0 -50
- data/spec/code/object/integer_spec.rb +0 -42
- data/spec/code/object/list_spec.rb +0 -22
- data/spec/code/object/nothing_spec.rb +0 -14
- data/spec/code/object/range_spec.rb +0 -23
- data/spec/code/object/string_spec.rb +0 -26
- data/spec/code/parser/boolean_spec.rb +0 -11
- data/spec/code/parser/chained_call_spec.rb +0 -16
- data/spec/code/parser/dictionary_spec.rb +0 -18
- data/spec/code/parser/function_spec.rb +0 -16
- data/spec/code/parser/group_spec.rb +0 -11
- data/spec/code/parser/if_modifier_spec.rb +0 -18
- data/spec/code/parser/list_spec.rb +0 -17
- data/spec/code/parser/number_spec.rb +0 -11
- data/spec/code/parser/string_spec.rb +0 -20
- data/spec/code/parser_spec.rb +0 -52
- data/spec/code/type_spec.rb +0 -21
- data/spec/code_spec.rb +0 -717
- data/spec/spec_helper.rb +0 -21
- data/spec/zeitwerk/loader_spec.rb +0 -7
data/lib/code/object/list.rb
CHANGED
|
@@ -3,6 +3,2575 @@
|
|
|
3
3
|
class Code
|
|
4
4
|
class Object
|
|
5
5
|
class List < Object
|
|
6
|
+
CLASS_DOCUMENTATION = {
|
|
7
|
+
name: "List",
|
|
8
|
+
description:
|
|
9
|
+
"stores ordered values and provides enumerable operations.",
|
|
10
|
+
examples: [
|
|
11
|
+
"[1, 2, 3]",
|
|
12
|
+
"[1, 2, 3].map((value) => { value * 2 })",
|
|
13
|
+
"List.new([1, 2])"
|
|
14
|
+
]
|
|
15
|
+
}.freeze
|
|
16
|
+
INSTANCE_FUNCTIONS = {
|
|
17
|
+
"[]" => {
|
|
18
|
+
name: "[]",
|
|
19
|
+
description: "returns the item at an index.",
|
|
20
|
+
examples: ["[1, 2, 3][0]", "[1, 2, 3][1]", "[:a, :b][0]"]
|
|
21
|
+
},
|
|
22
|
+
"at" => {
|
|
23
|
+
name: "at",
|
|
24
|
+
description: "returns the item at an index.",
|
|
25
|
+
examples: ["[1, 2, 3].at(0)", "[1, 2, 3].at(1)", "[:a, :b].at(0)"]
|
|
26
|
+
},
|
|
27
|
+
"get" => {
|
|
28
|
+
name: "get",
|
|
29
|
+
description: "returns the item at an index.",
|
|
30
|
+
examples: ["[1, 2, 3].get(0)", "[1, 2, 3].get(1)", "[:a, :b].get(0)"]
|
|
31
|
+
},
|
|
32
|
+
"fetch" => {
|
|
33
|
+
name: "fetch",
|
|
34
|
+
description: "returns the item at an index or nothing when missing.",
|
|
35
|
+
examples: ["[1, 2, 3].fetch(0)", "[1, 2, 3].fetch(2)", "[1].fetch(2)"]
|
|
36
|
+
},
|
|
37
|
+
"values_at" => {
|
|
38
|
+
name: "values_at",
|
|
39
|
+
description: "returns items at multiple indexes.",
|
|
40
|
+
examples: [
|
|
41
|
+
"[1, 2, 3].values_at(0, 2)",
|
|
42
|
+
"[:a, :b, :c].values_at(1, 2)",
|
|
43
|
+
"[1, 2, 3].values_at(0)"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"slice" => {
|
|
47
|
+
name: "slice",
|
|
48
|
+
description: "returns a slice from the list.",
|
|
49
|
+
examples: [
|
|
50
|
+
"[1, 2, 3].slice(0)",
|
|
51
|
+
"[1, 2, 3].slice(0, 2)",
|
|
52
|
+
"[:a, :b, :c].slice(1, 2)"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"slice!" => {
|
|
56
|
+
name: "slice!",
|
|
57
|
+
description: "removes and returns a slice from the list.",
|
|
58
|
+
examples: [
|
|
59
|
+
"[1, 2, 3].slice!(0)",
|
|
60
|
+
"[1, 2, 3].slice!(0, 2)",
|
|
61
|
+
"[:a, :b, :c].slice!(1, 2)"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"clear" => {
|
|
65
|
+
name: "clear",
|
|
66
|
+
description: "removes every item from the list and returns it.",
|
|
67
|
+
examples: ["[1, 2, 3].clear", "[].clear", "[:a].clear"]
|
|
68
|
+
},
|
|
69
|
+
"join" => {
|
|
70
|
+
name: "join",
|
|
71
|
+
description: "returns a string made by joining list items.",
|
|
72
|
+
examples: [
|
|
73
|
+
"[1, 2, 3].join",
|
|
74
|
+
"[1, 2, 3].join(\",\")",
|
|
75
|
+
"[:a, :b].join(\"-\")"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"sort" => {
|
|
79
|
+
name: "sort",
|
|
80
|
+
description:
|
|
81
|
+
"returns a new list sorted by item values or function results.",
|
|
82
|
+
examples: [
|
|
83
|
+
"[3, 1, 2].sort",
|
|
84
|
+
"[:b, :a].sort",
|
|
85
|
+
"[3, 1, 2].sort((x) => { x })"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
"sort!" => {
|
|
89
|
+
name: "sort!",
|
|
90
|
+
description:
|
|
91
|
+
"sorts the list in place by item values or function results.",
|
|
92
|
+
examples: [
|
|
93
|
+
"[3, 1, 2].sort!",
|
|
94
|
+
"[:b, :a].sort!",
|
|
95
|
+
"[3, 1, 2].sort!((x) => { x })"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"<<" => {
|
|
99
|
+
name: "<<",
|
|
100
|
+
description: "appends an item to the list and returns it.",
|
|
101
|
+
examples: ["[1, 2] << 3", "[] << :a", "[:a] << :b"]
|
|
102
|
+
},
|
|
103
|
+
"append" => {
|
|
104
|
+
name: "append",
|
|
105
|
+
description: "appends an item to the list and returns it.",
|
|
106
|
+
examples: ["[1, 2].append(3)", "[].append(:a)", "[:a].append(:b)"]
|
|
107
|
+
},
|
|
108
|
+
"push" => {
|
|
109
|
+
name: "push",
|
|
110
|
+
description: "appends an item to the list and returns it.",
|
|
111
|
+
examples: ["[1, 2].push(3)", "[].push(:a)", "[:a].push(:b)"]
|
|
112
|
+
},
|
|
113
|
+
"prepend" => {
|
|
114
|
+
name: "prepend",
|
|
115
|
+
description: "prepends an item to the list and returns it.",
|
|
116
|
+
examples: ["[2, 3].prepend(1)", "[].prepend(:a)", "[:b].prepend(:a)"]
|
|
117
|
+
},
|
|
118
|
+
"insert" => {
|
|
119
|
+
name: "insert",
|
|
120
|
+
description: "inserts an item at an index and returns the list.",
|
|
121
|
+
examples: [
|
|
122
|
+
"[1, 3].insert(1, 2)",
|
|
123
|
+
"[:b].insert(0, :a)",
|
|
124
|
+
"[1, 2].insert(2, 3)"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"concat" => {
|
|
128
|
+
name: "concat",
|
|
129
|
+
description: "appends lists to the list and returns it.",
|
|
130
|
+
examples: [
|
|
131
|
+
"[1].concat([2])",
|
|
132
|
+
"[1].concat([2], [3])",
|
|
133
|
+
"[].concat([:a])"
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"fill" => {
|
|
137
|
+
name: "fill",
|
|
138
|
+
description: "replaces list items with a value and returns the list.",
|
|
139
|
+
examples: [
|
|
140
|
+
"[1, 2, 3].fill(0)",
|
|
141
|
+
"[1, 2, 3].fill(0, 1)",
|
|
142
|
+
"[1, 2, 3].fill(0, 1, 2)"
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
"+" => {
|
|
146
|
+
name: "+",
|
|
147
|
+
description: "returns a new list with another list appended.",
|
|
148
|
+
examples: ["[1] + [2]", "[] + [:a]", "[1, 2] + [3]"]
|
|
149
|
+
},
|
|
150
|
+
"plus" => {
|
|
151
|
+
name: "plus",
|
|
152
|
+
description: "returns a new list with another list appended.",
|
|
153
|
+
examples: ["[1].plus([2])", "[].plus([:a])", "[1, 2].plus([3])"]
|
|
154
|
+
},
|
|
155
|
+
"-" => {
|
|
156
|
+
name: "-",
|
|
157
|
+
description: "returns a new list without items from another list.",
|
|
158
|
+
examples: ["[1, 2] - [2]", "[:a, :b] - [:a]", "[1, 2] - []"]
|
|
159
|
+
},
|
|
160
|
+
"minus" => {
|
|
161
|
+
name: "minus",
|
|
162
|
+
description: "returns a new list without items from another list.",
|
|
163
|
+
examples: [
|
|
164
|
+
"[1, 2].minus([2])",
|
|
165
|
+
"[:a, :b].minus([:a])",
|
|
166
|
+
"[1, 2].minus([])"
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
"any?" => {
|
|
170
|
+
name: "any?",
|
|
171
|
+
description:
|
|
172
|
+
"returns whether any item is present or matches a function or class.",
|
|
173
|
+
examples: [
|
|
174
|
+
"[1, 2, 3].any?",
|
|
175
|
+
"[1, 2, 3].any?((x) => { x > 2 })",
|
|
176
|
+
"[].any?"
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
"detect" => {
|
|
180
|
+
name: "detect",
|
|
181
|
+
description: "returns the first item matched by a function or class.",
|
|
182
|
+
examples: [
|
|
183
|
+
"[1, 2, 3].detect((x) => { x > 1 })",
|
|
184
|
+
"[1, 2, 3].detect(Integer)",
|
|
185
|
+
"[1, 2, 3].detect((x) => { x > 3 })"
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
"index" => {
|
|
189
|
+
name: "index",
|
|
190
|
+
description:
|
|
191
|
+
"returns the index of an item or first item matched by a function or class.",
|
|
192
|
+
examples: [
|
|
193
|
+
"[:a, :b].index(:b)",
|
|
194
|
+
"[1, 2, 3].index((x) => { x > 1 })",
|
|
195
|
+
"[:a].index(:missing)"
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
"find_index" => {
|
|
199
|
+
name: "find_index",
|
|
200
|
+
description:
|
|
201
|
+
"returns the index of an item or first item matched by a function or class.",
|
|
202
|
+
examples: [
|
|
203
|
+
"[:a, :b].find_index(:b)",
|
|
204
|
+
"[1, 2, 3].find_index((x) => { x > 1 })",
|
|
205
|
+
"[:a].find_index(:missing)"
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
"right_index" => {
|
|
209
|
+
name: "right_index",
|
|
210
|
+
description:
|
|
211
|
+
"returns the last index of an item or of an item matched by a function or class.",
|
|
212
|
+
examples: [
|
|
213
|
+
"[:a, :b, :a].right_index(:a)",
|
|
214
|
+
"[1, 2, 3].right_index((x) => { x > 1 })",
|
|
215
|
+
"[:a].right_index(:missing)"
|
|
216
|
+
]
|
|
217
|
+
},
|
|
218
|
+
"each" => {
|
|
219
|
+
name: "each",
|
|
220
|
+
description:
|
|
221
|
+
"calls a function or class for each item and returns the list.",
|
|
222
|
+
examples: [
|
|
223
|
+
"[1, 2, 3].each((x) => { x })",
|
|
224
|
+
"[:a, :b].each((x) => { x })",
|
|
225
|
+
"[].each((x) => { x })"
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
"each_index" => {
|
|
229
|
+
name: "each_index",
|
|
230
|
+
description:
|
|
231
|
+
"calls a function for each item index and returns the list.",
|
|
232
|
+
examples: [
|
|
233
|
+
"[1, 2, 3].each_index((i) => { i })",
|
|
234
|
+
"[:a, :b].each_index((i) => { i })",
|
|
235
|
+
"[].each_index((i) => { i })"
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
"first" => {
|
|
239
|
+
name: "first",
|
|
240
|
+
description: "returns the first item or first items.",
|
|
241
|
+
examples: ["[1, 2, 3].first", "[1, 2, 3].first(2)", "[].first"]
|
|
242
|
+
},
|
|
243
|
+
"second" => {
|
|
244
|
+
name: "second",
|
|
245
|
+
description: "returns the second item.",
|
|
246
|
+
examples: ["[1, 2, 3].second", "[:a, :b].second", "[1].second"]
|
|
247
|
+
},
|
|
248
|
+
"third" => {
|
|
249
|
+
name: "third",
|
|
250
|
+
description: "returns the third item.",
|
|
251
|
+
examples: ["[1, 2, 3].third", "[:a, :b, :c].third", "[1].third"]
|
|
252
|
+
},
|
|
253
|
+
"fourth" => {
|
|
254
|
+
name: "fourth",
|
|
255
|
+
description: "returns the fourth item.",
|
|
256
|
+
examples: [
|
|
257
|
+
"[1, 2, 3, 4].fourth",
|
|
258
|
+
"(1..5).to_list.fourth",
|
|
259
|
+
"[1].fourth"
|
|
260
|
+
]
|
|
261
|
+
},
|
|
262
|
+
"fifth" => {
|
|
263
|
+
name: "fifth",
|
|
264
|
+
description: "returns the fifth item.",
|
|
265
|
+
examples: [
|
|
266
|
+
"[1, 2, 3, 4, 5].fifth",
|
|
267
|
+
"(1..6).to_list.fifth",
|
|
268
|
+
"[1].fifth"
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
"sixth" => {
|
|
272
|
+
name: "sixth",
|
|
273
|
+
description: "returns the sixth item.",
|
|
274
|
+
examples: [
|
|
275
|
+
"(1..6).to_list.sixth",
|
|
276
|
+
"(1..7).to_list.sixth",
|
|
277
|
+
"[1].sixth"
|
|
278
|
+
]
|
|
279
|
+
},
|
|
280
|
+
"seventh" => {
|
|
281
|
+
name: "seventh",
|
|
282
|
+
description: "returns the seventh item.",
|
|
283
|
+
examples: [
|
|
284
|
+
"(1..7).to_list.seventh",
|
|
285
|
+
"(1..8).to_list.seventh",
|
|
286
|
+
"[1].seventh"
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
"eighth" => {
|
|
290
|
+
name: "eighth",
|
|
291
|
+
description: "returns the eighth item.",
|
|
292
|
+
examples: [
|
|
293
|
+
"(1..8).to_list.eighth",
|
|
294
|
+
"(1..9).to_list.eighth",
|
|
295
|
+
"[1].eighth"
|
|
296
|
+
]
|
|
297
|
+
},
|
|
298
|
+
"ninth" => {
|
|
299
|
+
name: "ninth",
|
|
300
|
+
description: "returns the ninth item.",
|
|
301
|
+
examples: [
|
|
302
|
+
"(1..9).to_list.ninth",
|
|
303
|
+
"(1..10).to_list.ninth",
|
|
304
|
+
"[1].ninth"
|
|
305
|
+
]
|
|
306
|
+
},
|
|
307
|
+
"tenth" => {
|
|
308
|
+
name: "tenth",
|
|
309
|
+
description: "returns the tenth item.",
|
|
310
|
+
examples: [
|
|
311
|
+
"(1..10).to_list.tenth",
|
|
312
|
+
"(1..11).to_list.tenth",
|
|
313
|
+
"[1].tenth"
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
"map" => {
|
|
317
|
+
name: "map",
|
|
318
|
+
description:
|
|
319
|
+
"returns a new list with each item transformed by a function or class.",
|
|
320
|
+
examples: [
|
|
321
|
+
"[1, 2, 3].map(Integer)",
|
|
322
|
+
"[:1, :2].map(Integer)",
|
|
323
|
+
"[1, 2].map((value) => { value + 1 })"
|
|
324
|
+
]
|
|
325
|
+
},
|
|
326
|
+
"sample" => {
|
|
327
|
+
name: "sample",
|
|
328
|
+
description: "returns a random item or random items from the list.",
|
|
329
|
+
examples: ["[1, 2, 3].sample", "[1, 2, 3].sample(2)", "[:a].sample"]
|
|
330
|
+
},
|
|
331
|
+
"shuffle" => {
|
|
332
|
+
name: "shuffle",
|
|
333
|
+
description: "returns a new list with items shuffled.",
|
|
334
|
+
examples: ["[1, 2, 3].shuffle", "[:a, :b].shuffle", "[].shuffle"]
|
|
335
|
+
},
|
|
336
|
+
"shuffle!" => {
|
|
337
|
+
name: "shuffle!",
|
|
338
|
+
description: "shuffles the list in place and returns it.",
|
|
339
|
+
examples: ["[1, 2, 3].shuffle!", "[:a, :b].shuffle!", "[].shuffle!"]
|
|
340
|
+
},
|
|
341
|
+
"flatten" => {
|
|
342
|
+
name: "flatten",
|
|
343
|
+
description: "returns a new list with nested lists flattened.",
|
|
344
|
+
examples: [
|
|
345
|
+
"[1, [2, 3]].flatten",
|
|
346
|
+
"[[1], [2]].flatten",
|
|
347
|
+
"[1, 2].flatten"
|
|
348
|
+
]
|
|
349
|
+
},
|
|
350
|
+
"delete" => {
|
|
351
|
+
name: "delete",
|
|
352
|
+
description:
|
|
353
|
+
"removes matching items from the list and returns the removed value.",
|
|
354
|
+
examples: [
|
|
355
|
+
"[1, 2, 2].delete(2)",
|
|
356
|
+
"[:a, :b].delete(:a)",
|
|
357
|
+
"[1].delete(2)"
|
|
358
|
+
]
|
|
359
|
+
},
|
|
360
|
+
"delete_at" => {
|
|
361
|
+
name: "delete_at",
|
|
362
|
+
description: "removes and returns the item at an index.",
|
|
363
|
+
examples: [
|
|
364
|
+
"[1, 2, 3].delete_at(1)",
|
|
365
|
+
"[:a, :b].delete_at(0)",
|
|
366
|
+
"[1].delete_at(2)"
|
|
367
|
+
]
|
|
368
|
+
},
|
|
369
|
+
"delete_if" => {
|
|
370
|
+
name: "delete_if",
|
|
371
|
+
description:
|
|
372
|
+
"removes items matched by a function or class and returns the list.",
|
|
373
|
+
examples: [
|
|
374
|
+
"[1, 2, 3].delete_if((x) => { x > 1 })",
|
|
375
|
+
"[:a, :b].delete_if((x) => { x == :a })",
|
|
376
|
+
"[].delete_if((x) => { x })"
|
|
377
|
+
]
|
|
378
|
+
},
|
|
379
|
+
"keep_if" => {
|
|
380
|
+
name: "keep_if",
|
|
381
|
+
description:
|
|
382
|
+
"keeps items matched by a function or class and returns the list.",
|
|
383
|
+
examples: [
|
|
384
|
+
"[1, 2, 3].keep_if((x) => { x > 1 })",
|
|
385
|
+
"[:a, :b].keep_if((x) => { x == :a })",
|
|
386
|
+
"[].keep_if((x) => { x })"
|
|
387
|
+
]
|
|
388
|
+
},
|
|
389
|
+
"pop" => {
|
|
390
|
+
name: "pop",
|
|
391
|
+
description:
|
|
392
|
+
"returns the last item or last items without mutating the list.",
|
|
393
|
+
examples: ["[1, 2, 3].pop", "[1, 2, 3].pop(2)", "[].pop"]
|
|
394
|
+
},
|
|
395
|
+
"pop!" => {
|
|
396
|
+
name: "pop!",
|
|
397
|
+
description: "removes and returns the last item or last items.",
|
|
398
|
+
examples: ["[1, 2, 3].pop!", "[1, 2, 3].pop!(2)", "[].pop!"]
|
|
399
|
+
},
|
|
400
|
+
"shift" => {
|
|
401
|
+
name: "shift",
|
|
402
|
+
description: "removes and returns the first item or first items.",
|
|
403
|
+
examples: ["[1, 2, 3].shift", "[1, 2, 3].shift(2)", "[].shift"]
|
|
404
|
+
},
|
|
405
|
+
"include?" => {
|
|
406
|
+
name: "include?",
|
|
407
|
+
description: "returns whether the list includes an item.",
|
|
408
|
+
examples: [
|
|
409
|
+
"[1, 2, 3].include?(2)",
|
|
410
|
+
"[:a, :b].include?(:c)",
|
|
411
|
+
"[].include?(1)"
|
|
412
|
+
]
|
|
413
|
+
},
|
|
414
|
+
"member?" => {
|
|
415
|
+
name: "member?",
|
|
416
|
+
description: "returns whether the list includes an item.",
|
|
417
|
+
examples: [
|
|
418
|
+
"[1, 2, 3].member?(2)",
|
|
419
|
+
"[:a, :b].member?(:c)",
|
|
420
|
+
"[].member?(1)"
|
|
421
|
+
]
|
|
422
|
+
},
|
|
423
|
+
"last" => {
|
|
424
|
+
name: "last",
|
|
425
|
+
description: "returns the last item.",
|
|
426
|
+
examples: ["[1, 2, 3].last", "[:a, :b].last", "[].last"]
|
|
427
|
+
},
|
|
428
|
+
"take" => {
|
|
429
|
+
name: "take",
|
|
430
|
+
description: "returns the first items from the list.",
|
|
431
|
+
examples: ["[1, 2, 3].take(2)", "[1, 2, 3].take(0)", "[].take(2)"]
|
|
432
|
+
},
|
|
433
|
+
"drop" => {
|
|
434
|
+
name: "drop",
|
|
435
|
+
description: "returns the list after dropping leading items.",
|
|
436
|
+
examples: ["[1, 2, 3].drop(1)", "[1, 2, 3].drop(3)", "[].drop(1)"]
|
|
437
|
+
},
|
|
438
|
+
"drop_while" => {
|
|
439
|
+
name: "drop_while",
|
|
440
|
+
description: "drops leading items while a function or class matches.",
|
|
441
|
+
examples: [
|
|
442
|
+
"[1, 2, 3].drop_while((x) => { x < 3 })",
|
|
443
|
+
"[1, 2, 3].drop_while((x) => { x < 1 })",
|
|
444
|
+
"[].drop_while((x) => { x })"
|
|
445
|
+
]
|
|
446
|
+
},
|
|
447
|
+
"take_while" => {
|
|
448
|
+
name: "take_while",
|
|
449
|
+
description: "takes leading items while a function or class matches.",
|
|
450
|
+
examples: [
|
|
451
|
+
"[1, 2, 3].take_while((x) => { x < 3 })",
|
|
452
|
+
"[1, 2, 3].take_while((x) => { x < 1 })",
|
|
453
|
+
"[].take_while((x) => { x })"
|
|
454
|
+
]
|
|
455
|
+
},
|
|
456
|
+
"zip" => {
|
|
457
|
+
name: "zip",
|
|
458
|
+
description: "returns a list by zipping items with other lists.",
|
|
459
|
+
examples: ["[1, 2].zip([3, 4])", "[:a, :b].zip([1, 2])", "[].zip([])"]
|
|
460
|
+
},
|
|
461
|
+
"map!" => {
|
|
462
|
+
name: "map!",
|
|
463
|
+
description: "transforms each item in place and returns the list.",
|
|
464
|
+
examples: [
|
|
465
|
+
"[1, 2, 3].map!((x) => { x + 1 })",
|
|
466
|
+
"[:1, :2].map!(Integer)",
|
|
467
|
+
"[].map!((x) => { x })"
|
|
468
|
+
]
|
|
469
|
+
},
|
|
470
|
+
"flat_map" => {
|
|
471
|
+
name: "flat_map",
|
|
472
|
+
description: "maps each item and flattens the result one level.",
|
|
473
|
+
examples: [
|
|
474
|
+
"[1, 2].flat_map((x) => { [x, x] })",
|
|
475
|
+
"[[1], [2]].flat_map((x) => { x })",
|
|
476
|
+
"[].flat_map((x) => { [x] })"
|
|
477
|
+
]
|
|
478
|
+
},
|
|
479
|
+
"max" => {
|
|
480
|
+
name: "max",
|
|
481
|
+
description: "returns the maximum item.",
|
|
482
|
+
examples: ["[1, 3, 2].max", "[:a, :b].max", "[].max"]
|
|
483
|
+
},
|
|
484
|
+
"maximum" => {
|
|
485
|
+
name: "maximum",
|
|
486
|
+
description: "returns the maximum item.",
|
|
487
|
+
examples: ["[1, 3, 2].maximum", "[:a, :b].maximum", "[].maximum"]
|
|
488
|
+
},
|
|
489
|
+
"minimum" => {
|
|
490
|
+
name: "minimum",
|
|
491
|
+
description: "returns the minimum item.",
|
|
492
|
+
examples: ["[1, 3, 2].minimum", "[:a, :b].minimum", "[].minimum"]
|
|
493
|
+
},
|
|
494
|
+
"minimum_maximum" => {
|
|
495
|
+
name: "minimum_maximum",
|
|
496
|
+
description: "returns the minimum and maximum items.",
|
|
497
|
+
examples: [
|
|
498
|
+
"[1, 3, 2].minimum_maximum",
|
|
499
|
+
"[:a, :b].minimum_maximum",
|
|
500
|
+
"[].minimum_maximum"
|
|
501
|
+
]
|
|
502
|
+
},
|
|
503
|
+
"none?" => {
|
|
504
|
+
name: "none?",
|
|
505
|
+
description:
|
|
506
|
+
"returns whether no items are present or match a function or class.",
|
|
507
|
+
examples: [
|
|
508
|
+
"[].none?",
|
|
509
|
+
"[1, 2, 3].none?((x) => { x > 3 })",
|
|
510
|
+
"[1, 2, 3].none?((x) => { x > 1 })"
|
|
511
|
+
]
|
|
512
|
+
},
|
|
513
|
+
"all?" => {
|
|
514
|
+
name: "all?",
|
|
515
|
+
description:
|
|
516
|
+
"returns whether all items are present or match a function or class.",
|
|
517
|
+
examples: [
|
|
518
|
+
"[1, 2, 3].all?",
|
|
519
|
+
"[1, 2, 3].all?((x) => { x > 0 })",
|
|
520
|
+
"[1, 2, 3].all?((x) => { x > 1 })"
|
|
521
|
+
]
|
|
522
|
+
},
|
|
523
|
+
"reduce" => {
|
|
524
|
+
name: "reduce",
|
|
525
|
+
description: "combines list items with a function.",
|
|
526
|
+
examples: [
|
|
527
|
+
"[1, 2, 3].reduce((sum, x) => { sum + x })",
|
|
528
|
+
"[1, 2, 3].reduce((sum, x) => { sum * x })",
|
|
529
|
+
"[:a, :b].reduce((left, right) => { left + right })"
|
|
530
|
+
]
|
|
531
|
+
},
|
|
532
|
+
"group" => {
|
|
533
|
+
name: "group",
|
|
534
|
+
description:
|
|
535
|
+
"returns a dictionary grouping items by a function result or class match.",
|
|
536
|
+
examples: [
|
|
537
|
+
"[1, 2, 3].group((x) => { x.even? })",
|
|
538
|
+
"[:a, :b].group(String)",
|
|
539
|
+
"[].group((x) => { x })"
|
|
540
|
+
]
|
|
541
|
+
},
|
|
542
|
+
"partition" => {
|
|
543
|
+
name: "partition",
|
|
544
|
+
description: "splits items into matching and non-matching lists.",
|
|
545
|
+
examples: [
|
|
546
|
+
"[1, 2, 3].partition((x) => { x > 1 })",
|
|
547
|
+
"[:a, :b].partition((x) => { x == :a })",
|
|
548
|
+
"[].partition((x) => { x })"
|
|
549
|
+
]
|
|
550
|
+
},
|
|
551
|
+
"cycle" => {
|
|
552
|
+
name: "cycle",
|
|
553
|
+
description:
|
|
554
|
+
"returns cycled items or calls a function for each cycled item.",
|
|
555
|
+
examples: [
|
|
556
|
+
"[1, 2].cycle(2)",
|
|
557
|
+
"[1, 2].cycle(2, (x) => { x })",
|
|
558
|
+
"[:a].cycle(3, (x) => { x })"
|
|
559
|
+
]
|
|
560
|
+
},
|
|
561
|
+
"transpose" => {
|
|
562
|
+
name: "transpose",
|
|
563
|
+
description: "returns rows and columns swapped.",
|
|
564
|
+
examples: [
|
|
565
|
+
"[[1, 2], [3, 4]].transpose",
|
|
566
|
+
"[[:a, :b], [:c, :d]].transpose",
|
|
567
|
+
"[].transpose"
|
|
568
|
+
]
|
|
569
|
+
},
|
|
570
|
+
"combination" => {
|
|
571
|
+
name: "combination",
|
|
572
|
+
description: "returns combinations of list items.",
|
|
573
|
+
examples: [
|
|
574
|
+
"[1, 2, 3].combination(2)",
|
|
575
|
+
"[:a, :b, :c].combination(1)",
|
|
576
|
+
"[].combination(2)"
|
|
577
|
+
]
|
|
578
|
+
},
|
|
579
|
+
"permutation" => {
|
|
580
|
+
name: "permutation",
|
|
581
|
+
description: "returns permutations of list items.",
|
|
582
|
+
examples: [
|
|
583
|
+
"[1, 2, 3].permutation(2)",
|
|
584
|
+
"[:a, :b].permutation",
|
|
585
|
+
"[].permutation"
|
|
586
|
+
]
|
|
587
|
+
},
|
|
588
|
+
"product" => {
|
|
589
|
+
name: "product",
|
|
590
|
+
description: "returns cartesian products with other lists.",
|
|
591
|
+
examples: [
|
|
592
|
+
"[1, 2].product([3, 4])",
|
|
593
|
+
"[:a, :b].product([1])",
|
|
594
|
+
"[].product([1, 2])"
|
|
595
|
+
]
|
|
596
|
+
},
|
|
597
|
+
"repeated_combination" => {
|
|
598
|
+
name: "repeated_combination",
|
|
599
|
+
description: "returns repeated combinations of list items.",
|
|
600
|
+
examples: [
|
|
601
|
+
"[1, 2].repeated_combination(2)",
|
|
602
|
+
"[:a, :b].repeated_combination(3)",
|
|
603
|
+
"[].repeated_combination(2)"
|
|
604
|
+
]
|
|
605
|
+
},
|
|
606
|
+
"repeated_permutation" => {
|
|
607
|
+
name: "repeated_permutation",
|
|
608
|
+
description: "returns repeated permutations of list items.",
|
|
609
|
+
examples: [
|
|
610
|
+
"[1, 2].repeated_permutation(2)",
|
|
611
|
+
"[:a, :b].repeated_permutation(3)",
|
|
612
|
+
"[].repeated_permutation(2)"
|
|
613
|
+
]
|
|
614
|
+
},
|
|
615
|
+
"reverse" => {
|
|
616
|
+
name: "reverse",
|
|
617
|
+
description: "returns a new list with items in reverse order.",
|
|
618
|
+
examples: ["[1, 2, 3].reverse", "[:a, :b].reverse", "[].reverse"]
|
|
619
|
+
},
|
|
620
|
+
"reverse!" => {
|
|
621
|
+
name: "reverse!",
|
|
622
|
+
description: "reverses the list in place and returns it.",
|
|
623
|
+
examples: ["[1, 2, 3].reverse!", "[:a, :b].reverse!", "[].reverse!"]
|
|
624
|
+
},
|
|
625
|
+
"reverse_each" => {
|
|
626
|
+
name: "reverse_each",
|
|
627
|
+
description: "calls a function for each item in reverse order.",
|
|
628
|
+
examples: [
|
|
629
|
+
"[1, 2, 3].reverse_each((x) => { x })",
|
|
630
|
+
"[:a, :b].reverse_each((x) => { x })",
|
|
631
|
+
"[].reverse_each((x) => { x })"
|
|
632
|
+
]
|
|
633
|
+
},
|
|
634
|
+
"rotate" => {
|
|
635
|
+
name: "rotate",
|
|
636
|
+
description: "returns a new list rotated by an offset.",
|
|
637
|
+
examples: [
|
|
638
|
+
"[1, 2, 3].rotate",
|
|
639
|
+
"[1, 2, 3].rotate(2)",
|
|
640
|
+
"[:a, :b].rotate"
|
|
641
|
+
]
|
|
642
|
+
},
|
|
643
|
+
"rotate!" => {
|
|
644
|
+
name: "rotate!",
|
|
645
|
+
description: "rotates the list in place and returns it.",
|
|
646
|
+
examples: [
|
|
647
|
+
"[1, 2, 3].rotate!",
|
|
648
|
+
"[1, 2, 3].rotate!(2)",
|
|
649
|
+
"[:a, :b].rotate!"
|
|
650
|
+
]
|
|
651
|
+
},
|
|
652
|
+
"union" => {
|
|
653
|
+
name: "union",
|
|
654
|
+
description: "returns a list containing unique items from each list.",
|
|
655
|
+
examples: [
|
|
656
|
+
"[1, 2].union([2, 3])",
|
|
657
|
+
"[:a].union([:b])",
|
|
658
|
+
"[].union([1])"
|
|
659
|
+
]
|
|
660
|
+
},
|
|
661
|
+
"intersection" => {
|
|
662
|
+
name: "intersection",
|
|
663
|
+
description: "returns items present in every list.",
|
|
664
|
+
examples: [
|
|
665
|
+
"[1, 2].intersection([2, 3])",
|
|
666
|
+
"[:a, :b].intersection([:b])",
|
|
667
|
+
"[].intersection([1])"
|
|
668
|
+
]
|
|
669
|
+
},
|
|
670
|
+
"difference" => {
|
|
671
|
+
name: "difference",
|
|
672
|
+
description: "returns items not present in another list.",
|
|
673
|
+
examples: [
|
|
674
|
+
"[1, 2].difference([2])",
|
|
675
|
+
"[:a, :b].difference([:a])",
|
|
676
|
+
"[].difference([1])"
|
|
677
|
+
]
|
|
678
|
+
},
|
|
679
|
+
"intersect?" => {
|
|
680
|
+
name: "intersect?",
|
|
681
|
+
description:
|
|
682
|
+
"returns whether the list shares items with another list.",
|
|
683
|
+
examples: [
|
|
684
|
+
"[1, 2].intersect?([2, 3])",
|
|
685
|
+
"[:a].intersect?([:b])",
|
|
686
|
+
"[].intersect?([1])"
|
|
687
|
+
]
|
|
688
|
+
},
|
|
689
|
+
"associate" => {
|
|
690
|
+
name: "associate",
|
|
691
|
+
description:
|
|
692
|
+
"returns the first nested list whose first item matches a value.",
|
|
693
|
+
examples: [
|
|
694
|
+
"[[:a, 1], [:b, 2]].associate(:a)",
|
|
695
|
+
"[[1, :a], [2, :b]].associate(2)",
|
|
696
|
+
"[[:a, 1]].associate(:missing)"
|
|
697
|
+
]
|
|
698
|
+
},
|
|
699
|
+
"right_associate" => {
|
|
700
|
+
name: "right_associate",
|
|
701
|
+
description:
|
|
702
|
+
"returns the first nested list whose second item matches a value.",
|
|
703
|
+
examples: [
|
|
704
|
+
"[[1, :a], [2, :b]].right_associate(:a)",
|
|
705
|
+
"[[:a, 1], [:b, 2]].right_associate(2)",
|
|
706
|
+
"[[:a, 1]].right_associate(:missing)"
|
|
707
|
+
]
|
|
708
|
+
},
|
|
709
|
+
"select" => {
|
|
710
|
+
name: "select",
|
|
711
|
+
description: "returns items matched by a function or class.",
|
|
712
|
+
examples: [
|
|
713
|
+
"[1, 2, 3].select((x) => { x > 1 })",
|
|
714
|
+
"[1, :a, 2].select(Integer)",
|
|
715
|
+
"[].select((x) => { x })"
|
|
716
|
+
]
|
|
717
|
+
},
|
|
718
|
+
"filter" => {
|
|
719
|
+
name: "filter",
|
|
720
|
+
description: "returns items matched by a function or class.",
|
|
721
|
+
examples: [
|
|
722
|
+
"[1, 2, 3].filter((x) => { x > 1 })",
|
|
723
|
+
"[1, :a, 2].filter(Integer)",
|
|
724
|
+
"[].filter((x) => { x })"
|
|
725
|
+
]
|
|
726
|
+
},
|
|
727
|
+
"select!" => {
|
|
728
|
+
name: "select!",
|
|
729
|
+
description:
|
|
730
|
+
"keeps items matched by a function or class and returns the list.",
|
|
731
|
+
examples: [
|
|
732
|
+
"[1, 2, 3].select!((x) => { x > 1 })",
|
|
733
|
+
"[1, :a, 2].select!(Integer)",
|
|
734
|
+
"[].select!((x) => { x })"
|
|
735
|
+
]
|
|
736
|
+
},
|
|
737
|
+
"filter!" => {
|
|
738
|
+
name: "filter!",
|
|
739
|
+
description:
|
|
740
|
+
"keeps items matched by a function or class and returns the list.",
|
|
741
|
+
examples: [
|
|
742
|
+
"[1, 2, 3].filter!((x) => { x > 1 })",
|
|
743
|
+
"[1, :a, 2].filter!(Integer)",
|
|
744
|
+
"[].filter!((x) => { x })"
|
|
745
|
+
]
|
|
746
|
+
},
|
|
747
|
+
"compact" => {
|
|
748
|
+
name: "compact",
|
|
749
|
+
description:
|
|
750
|
+
"returns a new list without nothing values or matched items.",
|
|
751
|
+
examples: [
|
|
752
|
+
"[1, nothing, 2].compact",
|
|
753
|
+
"[1, :a, 2].compact(String)",
|
|
754
|
+
"[1, 2, 3].compact((x) => { x > 1 })"
|
|
755
|
+
]
|
|
756
|
+
},
|
|
757
|
+
"compact!" => {
|
|
758
|
+
name: "compact!",
|
|
759
|
+
description:
|
|
760
|
+
"removes nothing values or matched items in place and returns the list.",
|
|
761
|
+
examples: [
|
|
762
|
+
"[1, nothing, 2].compact!",
|
|
763
|
+
"[1, :a, 2].compact!(String)",
|
|
764
|
+
"[1, 2, 3].compact!((x) => { x > 1 })"
|
|
765
|
+
]
|
|
766
|
+
},
|
|
767
|
+
"reject" => {
|
|
768
|
+
name: "reject",
|
|
769
|
+
description: "returns items not matched by a function or class.",
|
|
770
|
+
examples: [
|
|
771
|
+
"[1, 2, 3].reject((x) => { x > 1 })",
|
|
772
|
+
"[1, :a, 2].reject(Integer)",
|
|
773
|
+
"[].reject((x) => { x })"
|
|
774
|
+
]
|
|
775
|
+
},
|
|
776
|
+
"reject!" => {
|
|
777
|
+
name: "reject!",
|
|
778
|
+
description:
|
|
779
|
+
"removes items matched by a function or class and returns the list.",
|
|
780
|
+
examples: [
|
|
781
|
+
"[1, 2, 3].reject!((x) => { x > 1 })",
|
|
782
|
+
"[1, :a, 2].reject!(Integer)",
|
|
783
|
+
"[].reject!((x) => { x })"
|
|
784
|
+
]
|
|
785
|
+
},
|
|
786
|
+
"size" => {
|
|
787
|
+
name: "size",
|
|
788
|
+
description: "returns the number of items in the list.",
|
|
789
|
+
examples: ["[1, 2, 3].size", "[].size", "[:a].size"]
|
|
790
|
+
},
|
|
791
|
+
"length" => {
|
|
792
|
+
name: "length",
|
|
793
|
+
description: "returns the number of items in the list.",
|
|
794
|
+
examples: ["[1, 2, 3].length", "[].length", "[:a].length"]
|
|
795
|
+
},
|
|
796
|
+
"empty?" => {
|
|
797
|
+
name: "empty?",
|
|
798
|
+
description: "returns whether the list has no items.",
|
|
799
|
+
examples: ["[].empty?", "[1].empty?", "[:a, :b].empty?"]
|
|
800
|
+
},
|
|
801
|
+
"count" => {
|
|
802
|
+
name: "count",
|
|
803
|
+
description: "returns the number of items or matching items.",
|
|
804
|
+
examples: [
|
|
805
|
+
"[1, 2, 3].count",
|
|
806
|
+
"[1, 2, 2].count((x) => { x == 2 })",
|
|
807
|
+
"[1, 2, 3].count((x) => { x > 1 })"
|
|
808
|
+
]
|
|
809
|
+
},
|
|
810
|
+
"sum" => {
|
|
811
|
+
name: "sum",
|
|
812
|
+
description: "returns the sum of list items.",
|
|
813
|
+
examples: ["[1, 2, 3].sum", "[].sum", "[10, 20].sum"]
|
|
814
|
+
},
|
|
815
|
+
"tally" => {
|
|
816
|
+
name: "tally",
|
|
817
|
+
description: "returns a dictionary counting each item.",
|
|
818
|
+
examples: ["[:a, :b, :a].tally", "[1, 1, 2].tally", "[].tally"]
|
|
819
|
+
},
|
|
820
|
+
"entries" => {
|
|
821
|
+
name: "entries",
|
|
822
|
+
description: "returns the list itself.",
|
|
823
|
+
examples: ["[1, 2, 3].entries", "[].entries", "[:a].entries"]
|
|
824
|
+
},
|
|
825
|
+
"to_dictionary" => {
|
|
826
|
+
name: "to_dictionary",
|
|
827
|
+
description:
|
|
828
|
+
"converts the list to a dictionary using entry pairs or indexes.",
|
|
829
|
+
examples: [
|
|
830
|
+
"[[:a, 1], [:b, 2]].to_dictionary",
|
|
831
|
+
"[\"a\", \"b\"].to_dictionary",
|
|
832
|
+
"[].to_dictionary"
|
|
833
|
+
]
|
|
834
|
+
},
|
|
835
|
+
"uniq" => {
|
|
836
|
+
name: "uniq",
|
|
837
|
+
description: "returns a new list with duplicate items removed.",
|
|
838
|
+
examples: [
|
|
839
|
+
"[1, 1, 2].uniq",
|
|
840
|
+
"[:a, :a].uniq",
|
|
841
|
+
"[1, 2, 3].uniq((x) => { x > 1 })"
|
|
842
|
+
]
|
|
843
|
+
},
|
|
844
|
+
"sort_by!" => {
|
|
845
|
+
name: "sort_by!",
|
|
846
|
+
description: "sorts the list in place by function results.",
|
|
847
|
+
examples: [
|
|
848
|
+
"[3, 1, 2].sort_by!((x) => { x })",
|
|
849
|
+
"[:bb, :a].sort_by!((x) => { x.size })",
|
|
850
|
+
"[].sort_by!((x) => { x })"
|
|
851
|
+
]
|
|
852
|
+
},
|
|
853
|
+
"uniq!" => {
|
|
854
|
+
name: "uniq!",
|
|
855
|
+
description: "removes duplicate items in place and returns the list.",
|
|
856
|
+
examples: [
|
|
857
|
+
"[1, 1, 2].uniq!",
|
|
858
|
+
"[:a, :a].uniq!",
|
|
859
|
+
"[1, 2, 3].uniq!((x) => { x > 1 })"
|
|
860
|
+
]
|
|
861
|
+
},
|
|
862
|
+
"eleventh" => {
|
|
863
|
+
name: "eleventh",
|
|
864
|
+
description: "returns the eleventh item.",
|
|
865
|
+
examples: [
|
|
866
|
+
"(1..11).to_list.eleventh",
|
|
867
|
+
"(1..12).to_list.eleventh",
|
|
868
|
+
"[].eleventh"
|
|
869
|
+
]
|
|
870
|
+
},
|
|
871
|
+
"twelfth" => {
|
|
872
|
+
name: "twelfth",
|
|
873
|
+
description: "returns the twelfth item.",
|
|
874
|
+
examples: [
|
|
875
|
+
"(1..12).to_list.twelfth",
|
|
876
|
+
"(1..13).to_list.twelfth",
|
|
877
|
+
"[].twelfth"
|
|
878
|
+
]
|
|
879
|
+
},
|
|
880
|
+
"thirteenth" => {
|
|
881
|
+
name: "thirteenth",
|
|
882
|
+
description: "returns the thirteenth item.",
|
|
883
|
+
examples: [
|
|
884
|
+
"(1..13).to_list.thirteenth",
|
|
885
|
+
"(1..14).to_list.thirteenth",
|
|
886
|
+
"[].thirteenth"
|
|
887
|
+
]
|
|
888
|
+
},
|
|
889
|
+
"fourteenth" => {
|
|
890
|
+
name: "fourteenth",
|
|
891
|
+
description: "returns the fourteenth item.",
|
|
892
|
+
examples: [
|
|
893
|
+
"(1..14).to_list.fourteenth",
|
|
894
|
+
"(1..15).to_list.fourteenth",
|
|
895
|
+
"[].fourteenth"
|
|
896
|
+
]
|
|
897
|
+
},
|
|
898
|
+
"fifteenth" => {
|
|
899
|
+
name: "fifteenth",
|
|
900
|
+
description: "returns the fifteenth item.",
|
|
901
|
+
examples: [
|
|
902
|
+
"(1..15).to_list.fifteenth",
|
|
903
|
+
"(1..16).to_list.fifteenth",
|
|
904
|
+
"[].fifteenth"
|
|
905
|
+
]
|
|
906
|
+
},
|
|
907
|
+
"sixteenth" => {
|
|
908
|
+
name: "sixteenth",
|
|
909
|
+
description: "returns the sixteenth item.",
|
|
910
|
+
examples: [
|
|
911
|
+
"(1..16).to_list.sixteenth",
|
|
912
|
+
"(1..17).to_list.sixteenth",
|
|
913
|
+
"[].sixteenth"
|
|
914
|
+
]
|
|
915
|
+
},
|
|
916
|
+
"seventeenth" => {
|
|
917
|
+
name: "seventeenth",
|
|
918
|
+
description: "returns the seventeenth item.",
|
|
919
|
+
examples: [
|
|
920
|
+
"(1..17).to_list.seventeenth",
|
|
921
|
+
"(1..18).to_list.seventeenth",
|
|
922
|
+
"[].seventeenth"
|
|
923
|
+
]
|
|
924
|
+
},
|
|
925
|
+
"eighteenth" => {
|
|
926
|
+
name: "eighteenth",
|
|
927
|
+
description: "returns the eighteenth item.",
|
|
928
|
+
examples: [
|
|
929
|
+
"(1..18).to_list.eighteenth",
|
|
930
|
+
"(1..19).to_list.eighteenth",
|
|
931
|
+
"[].eighteenth"
|
|
932
|
+
]
|
|
933
|
+
},
|
|
934
|
+
"nineteenth" => {
|
|
935
|
+
name: "nineteenth",
|
|
936
|
+
description: "returns the nineteenth item.",
|
|
937
|
+
examples: [
|
|
938
|
+
"(1..19).to_list.nineteenth",
|
|
939
|
+
"(1..20).to_list.nineteenth",
|
|
940
|
+
"[].nineteenth"
|
|
941
|
+
]
|
|
942
|
+
},
|
|
943
|
+
"twentieth" => {
|
|
944
|
+
name: "twentieth",
|
|
945
|
+
description: "returns the twentieth item.",
|
|
946
|
+
examples: [
|
|
947
|
+
"(1..20).to_list.twentieth",
|
|
948
|
+
"(1..21).to_list.twentieth",
|
|
949
|
+
"[].twentieth"
|
|
950
|
+
]
|
|
951
|
+
},
|
|
952
|
+
"twenty_first" => {
|
|
953
|
+
name: "twenty_first",
|
|
954
|
+
description: "returns the twenty first item.",
|
|
955
|
+
examples: [
|
|
956
|
+
"(1..21).to_list.twenty_first",
|
|
957
|
+
"(1..22).to_list.twenty_first",
|
|
958
|
+
"[].twenty_first"
|
|
959
|
+
]
|
|
960
|
+
},
|
|
961
|
+
"twenty_second" => {
|
|
962
|
+
name: "twenty_second",
|
|
963
|
+
description: "returns the twenty second item.",
|
|
964
|
+
examples: [
|
|
965
|
+
"(1..22).to_list.twenty_second",
|
|
966
|
+
"(1..23).to_list.twenty_second",
|
|
967
|
+
"[].twenty_second"
|
|
968
|
+
]
|
|
969
|
+
},
|
|
970
|
+
"twenty_third" => {
|
|
971
|
+
name: "twenty_third",
|
|
972
|
+
description: "returns the twenty third item.",
|
|
973
|
+
examples: [
|
|
974
|
+
"(1..23).to_list.twenty_third",
|
|
975
|
+
"(1..24).to_list.twenty_third",
|
|
976
|
+
"[].twenty_third"
|
|
977
|
+
]
|
|
978
|
+
},
|
|
979
|
+
"twenty_fourth" => {
|
|
980
|
+
name: "twenty_fourth",
|
|
981
|
+
description: "returns the twenty fourth item.",
|
|
982
|
+
examples: [
|
|
983
|
+
"(1..24).to_list.twenty_fourth",
|
|
984
|
+
"(1..25).to_list.twenty_fourth",
|
|
985
|
+
"[].twenty_fourth"
|
|
986
|
+
]
|
|
987
|
+
},
|
|
988
|
+
"twenty_fifth" => {
|
|
989
|
+
name: "twenty_fifth",
|
|
990
|
+
description: "returns the twenty fifth item.",
|
|
991
|
+
examples: [
|
|
992
|
+
"(1..25).to_list.twenty_fifth",
|
|
993
|
+
"(1..26).to_list.twenty_fifth",
|
|
994
|
+
"[].twenty_fifth"
|
|
995
|
+
]
|
|
996
|
+
},
|
|
997
|
+
"twenty_sixth" => {
|
|
998
|
+
name: "twenty_sixth",
|
|
999
|
+
description: "returns the twenty sixth item.",
|
|
1000
|
+
examples: [
|
|
1001
|
+
"(1..26).to_list.twenty_sixth",
|
|
1002
|
+
"(1..27).to_list.twenty_sixth",
|
|
1003
|
+
"[].twenty_sixth"
|
|
1004
|
+
]
|
|
1005
|
+
},
|
|
1006
|
+
"twenty_seventh" => {
|
|
1007
|
+
name: "twenty_seventh",
|
|
1008
|
+
description: "returns the twenty seventh item.",
|
|
1009
|
+
examples: [
|
|
1010
|
+
"(1..27).to_list.twenty_seventh",
|
|
1011
|
+
"(1..28).to_list.twenty_seventh",
|
|
1012
|
+
"[].twenty_seventh"
|
|
1013
|
+
]
|
|
1014
|
+
},
|
|
1015
|
+
"twenty_eighth" => {
|
|
1016
|
+
name: "twenty_eighth",
|
|
1017
|
+
description: "returns the twenty eighth item.",
|
|
1018
|
+
examples: [
|
|
1019
|
+
"(1..28).to_list.twenty_eighth",
|
|
1020
|
+
"(1..29).to_list.twenty_eighth",
|
|
1021
|
+
"[].twenty_eighth"
|
|
1022
|
+
]
|
|
1023
|
+
},
|
|
1024
|
+
"twenty_ninth" => {
|
|
1025
|
+
name: "twenty_ninth",
|
|
1026
|
+
description: "returns the twenty ninth item.",
|
|
1027
|
+
examples: [
|
|
1028
|
+
"(1..29).to_list.twenty_ninth",
|
|
1029
|
+
"(1..30).to_list.twenty_ninth",
|
|
1030
|
+
"[].twenty_ninth"
|
|
1031
|
+
]
|
|
1032
|
+
},
|
|
1033
|
+
"thirtieth" => {
|
|
1034
|
+
name: "thirtieth",
|
|
1035
|
+
description: "returns the thirtieth item.",
|
|
1036
|
+
examples: [
|
|
1037
|
+
"(1..30).to_list.thirtieth",
|
|
1038
|
+
"(1..31).to_list.thirtieth",
|
|
1039
|
+
"[].thirtieth"
|
|
1040
|
+
]
|
|
1041
|
+
},
|
|
1042
|
+
"thirty_first" => {
|
|
1043
|
+
name: "thirty_first",
|
|
1044
|
+
description: "returns the thirty first item.",
|
|
1045
|
+
examples: [
|
|
1046
|
+
"(1..31).to_list.thirty_first",
|
|
1047
|
+
"(1..32).to_list.thirty_first",
|
|
1048
|
+
"[].thirty_first"
|
|
1049
|
+
]
|
|
1050
|
+
},
|
|
1051
|
+
"thirty_second" => {
|
|
1052
|
+
name: "thirty_second",
|
|
1053
|
+
description: "returns the thirty second item.",
|
|
1054
|
+
examples: [
|
|
1055
|
+
"(1..32).to_list.thirty_second",
|
|
1056
|
+
"(1..33).to_list.thirty_second",
|
|
1057
|
+
"[].thirty_second"
|
|
1058
|
+
]
|
|
1059
|
+
},
|
|
1060
|
+
"thirty_third" => {
|
|
1061
|
+
name: "thirty_third",
|
|
1062
|
+
description: "returns the thirty third item.",
|
|
1063
|
+
examples: [
|
|
1064
|
+
"(1..33).to_list.thirty_third",
|
|
1065
|
+
"(1..34).to_list.thirty_third",
|
|
1066
|
+
"[].thirty_third"
|
|
1067
|
+
]
|
|
1068
|
+
},
|
|
1069
|
+
"thirty_fourth" => {
|
|
1070
|
+
name: "thirty_fourth",
|
|
1071
|
+
description: "returns the thirty fourth item.",
|
|
1072
|
+
examples: [
|
|
1073
|
+
"(1..34).to_list.thirty_fourth",
|
|
1074
|
+
"(1..35).to_list.thirty_fourth",
|
|
1075
|
+
"[].thirty_fourth"
|
|
1076
|
+
]
|
|
1077
|
+
},
|
|
1078
|
+
"thirty_fifth" => {
|
|
1079
|
+
name: "thirty_fifth",
|
|
1080
|
+
description: "returns the thirty fifth item.",
|
|
1081
|
+
examples: [
|
|
1082
|
+
"(1..35).to_list.thirty_fifth",
|
|
1083
|
+
"(1..36).to_list.thirty_fifth",
|
|
1084
|
+
"[].thirty_fifth"
|
|
1085
|
+
]
|
|
1086
|
+
},
|
|
1087
|
+
"thirty_sixth" => {
|
|
1088
|
+
name: "thirty_sixth",
|
|
1089
|
+
description: "returns the thirty sixth item.",
|
|
1090
|
+
examples: [
|
|
1091
|
+
"(1..36).to_list.thirty_sixth",
|
|
1092
|
+
"(1..37).to_list.thirty_sixth",
|
|
1093
|
+
"[].thirty_sixth"
|
|
1094
|
+
]
|
|
1095
|
+
},
|
|
1096
|
+
"thirty_seventh" => {
|
|
1097
|
+
name: "thirty_seventh",
|
|
1098
|
+
description: "returns the thirty seventh item.",
|
|
1099
|
+
examples: [
|
|
1100
|
+
"(1..37).to_list.thirty_seventh",
|
|
1101
|
+
"(1..38).to_list.thirty_seventh",
|
|
1102
|
+
"[].thirty_seventh"
|
|
1103
|
+
]
|
|
1104
|
+
},
|
|
1105
|
+
"thirty_eighth" => {
|
|
1106
|
+
name: "thirty_eighth",
|
|
1107
|
+
description: "returns the thirty eighth item.",
|
|
1108
|
+
examples: [
|
|
1109
|
+
"(1..38).to_list.thirty_eighth",
|
|
1110
|
+
"(1..39).to_list.thirty_eighth",
|
|
1111
|
+
"[].thirty_eighth"
|
|
1112
|
+
]
|
|
1113
|
+
},
|
|
1114
|
+
"thirty_ninth" => {
|
|
1115
|
+
name: "thirty_ninth",
|
|
1116
|
+
description: "returns the thirty ninth item.",
|
|
1117
|
+
examples: [
|
|
1118
|
+
"(1..39).to_list.thirty_ninth",
|
|
1119
|
+
"(1..40).to_list.thirty_ninth",
|
|
1120
|
+
"[].thirty_ninth"
|
|
1121
|
+
]
|
|
1122
|
+
},
|
|
1123
|
+
"fortieth" => {
|
|
1124
|
+
name: "fortieth",
|
|
1125
|
+
description: "returns the fortieth item.",
|
|
1126
|
+
examples: [
|
|
1127
|
+
"(1..40).to_list.fortieth",
|
|
1128
|
+
"(1..41).to_list.fortieth",
|
|
1129
|
+
"[].fortieth"
|
|
1130
|
+
]
|
|
1131
|
+
},
|
|
1132
|
+
"forty_first" => {
|
|
1133
|
+
name: "forty_first",
|
|
1134
|
+
description: "returns the forty first item.",
|
|
1135
|
+
examples: [
|
|
1136
|
+
"(1..41).to_list.forty_first",
|
|
1137
|
+
"(1..42).to_list.forty_first",
|
|
1138
|
+
"[].forty_first"
|
|
1139
|
+
]
|
|
1140
|
+
},
|
|
1141
|
+
"forty_second" => {
|
|
1142
|
+
name: "forty_second",
|
|
1143
|
+
description: "returns the forty second item.",
|
|
1144
|
+
examples: [
|
|
1145
|
+
"(1..42).to_list.forty_second",
|
|
1146
|
+
"(1..43).to_list.forty_second",
|
|
1147
|
+
"[].forty_second"
|
|
1148
|
+
]
|
|
1149
|
+
},
|
|
1150
|
+
"forty_third" => {
|
|
1151
|
+
name: "forty_third",
|
|
1152
|
+
description: "returns the forty third item.",
|
|
1153
|
+
examples: [
|
|
1154
|
+
"(1..43).to_list.forty_third",
|
|
1155
|
+
"(1..44).to_list.forty_third",
|
|
1156
|
+
"[].forty_third"
|
|
1157
|
+
]
|
|
1158
|
+
},
|
|
1159
|
+
"forty_fourth" => {
|
|
1160
|
+
name: "forty_fourth",
|
|
1161
|
+
description: "returns the forty fourth item.",
|
|
1162
|
+
examples: [
|
|
1163
|
+
"(1..44).to_list.forty_fourth",
|
|
1164
|
+
"(1..45).to_list.forty_fourth",
|
|
1165
|
+
"[].forty_fourth"
|
|
1166
|
+
]
|
|
1167
|
+
},
|
|
1168
|
+
"forty_fifth" => {
|
|
1169
|
+
name: "forty_fifth",
|
|
1170
|
+
description: "returns the forty fifth item.",
|
|
1171
|
+
examples: [
|
|
1172
|
+
"(1..45).to_list.forty_fifth",
|
|
1173
|
+
"(1..46).to_list.forty_fifth",
|
|
1174
|
+
"[].forty_fifth"
|
|
1175
|
+
]
|
|
1176
|
+
},
|
|
1177
|
+
"forty_sixth" => {
|
|
1178
|
+
name: "forty_sixth",
|
|
1179
|
+
description: "returns the forty sixth item.",
|
|
1180
|
+
examples: [
|
|
1181
|
+
"(1..46).to_list.forty_sixth",
|
|
1182
|
+
"(1..47).to_list.forty_sixth",
|
|
1183
|
+
"[].forty_sixth"
|
|
1184
|
+
]
|
|
1185
|
+
},
|
|
1186
|
+
"forty_seventh" => {
|
|
1187
|
+
name: "forty_seventh",
|
|
1188
|
+
description: "returns the forty seventh item.",
|
|
1189
|
+
examples: [
|
|
1190
|
+
"(1..47).to_list.forty_seventh",
|
|
1191
|
+
"(1..48).to_list.forty_seventh",
|
|
1192
|
+
"[].forty_seventh"
|
|
1193
|
+
]
|
|
1194
|
+
},
|
|
1195
|
+
"forty_eighth" => {
|
|
1196
|
+
name: "forty_eighth",
|
|
1197
|
+
description: "returns the forty eighth item.",
|
|
1198
|
+
examples: [
|
|
1199
|
+
"(1..48).to_list.forty_eighth",
|
|
1200
|
+
"(1..49).to_list.forty_eighth",
|
|
1201
|
+
"[].forty_eighth"
|
|
1202
|
+
]
|
|
1203
|
+
},
|
|
1204
|
+
"forty_ninth" => {
|
|
1205
|
+
name: "forty_ninth",
|
|
1206
|
+
description: "returns the forty ninth item.",
|
|
1207
|
+
examples: [
|
|
1208
|
+
"(1..49).to_list.forty_ninth",
|
|
1209
|
+
"(1..50).to_list.forty_ninth",
|
|
1210
|
+
"[].forty_ninth"
|
|
1211
|
+
]
|
|
1212
|
+
},
|
|
1213
|
+
"fiftieth" => {
|
|
1214
|
+
name: "fiftieth",
|
|
1215
|
+
description: "returns the fiftieth item.",
|
|
1216
|
+
examples: [
|
|
1217
|
+
"(1..50).to_list.fiftieth",
|
|
1218
|
+
"(1..51).to_list.fiftieth",
|
|
1219
|
+
"[].fiftieth"
|
|
1220
|
+
]
|
|
1221
|
+
},
|
|
1222
|
+
"fifty_first" => {
|
|
1223
|
+
name: "fifty_first",
|
|
1224
|
+
description: "returns the fifty first item.",
|
|
1225
|
+
examples: [
|
|
1226
|
+
"(1..51).to_list.fifty_first",
|
|
1227
|
+
"(1..52).to_list.fifty_first",
|
|
1228
|
+
"[].fifty_first"
|
|
1229
|
+
]
|
|
1230
|
+
},
|
|
1231
|
+
"fifty_second" => {
|
|
1232
|
+
name: "fifty_second",
|
|
1233
|
+
description: "returns the fifty second item.",
|
|
1234
|
+
examples: [
|
|
1235
|
+
"(1..52).to_list.fifty_second",
|
|
1236
|
+
"(1..53).to_list.fifty_second",
|
|
1237
|
+
"[].fifty_second"
|
|
1238
|
+
]
|
|
1239
|
+
},
|
|
1240
|
+
"fifty_third" => {
|
|
1241
|
+
name: "fifty_third",
|
|
1242
|
+
description: "returns the fifty third item.",
|
|
1243
|
+
examples: [
|
|
1244
|
+
"(1..53).to_list.fifty_third",
|
|
1245
|
+
"(1..54).to_list.fifty_third",
|
|
1246
|
+
"[].fifty_third"
|
|
1247
|
+
]
|
|
1248
|
+
},
|
|
1249
|
+
"fifty_fourth" => {
|
|
1250
|
+
name: "fifty_fourth",
|
|
1251
|
+
description: "returns the fifty fourth item.",
|
|
1252
|
+
examples: [
|
|
1253
|
+
"(1..54).to_list.fifty_fourth",
|
|
1254
|
+
"(1..55).to_list.fifty_fourth",
|
|
1255
|
+
"[].fifty_fourth"
|
|
1256
|
+
]
|
|
1257
|
+
},
|
|
1258
|
+
"fifty_fifth" => {
|
|
1259
|
+
name: "fifty_fifth",
|
|
1260
|
+
description: "returns the fifty fifth item.",
|
|
1261
|
+
examples: [
|
|
1262
|
+
"(1..55).to_list.fifty_fifth",
|
|
1263
|
+
"(1..56).to_list.fifty_fifth",
|
|
1264
|
+
"[].fifty_fifth"
|
|
1265
|
+
]
|
|
1266
|
+
},
|
|
1267
|
+
"fifty_sixth" => {
|
|
1268
|
+
name: "fifty_sixth",
|
|
1269
|
+
description: "returns the fifty sixth item.",
|
|
1270
|
+
examples: [
|
|
1271
|
+
"(1..56).to_list.fifty_sixth",
|
|
1272
|
+
"(1..57).to_list.fifty_sixth",
|
|
1273
|
+
"[].fifty_sixth"
|
|
1274
|
+
]
|
|
1275
|
+
},
|
|
1276
|
+
"fifty_seventh" => {
|
|
1277
|
+
name: "fifty_seventh",
|
|
1278
|
+
description: "returns the fifty seventh item.",
|
|
1279
|
+
examples: [
|
|
1280
|
+
"(1..57).to_list.fifty_seventh",
|
|
1281
|
+
"(1..58).to_list.fifty_seventh",
|
|
1282
|
+
"[].fifty_seventh"
|
|
1283
|
+
]
|
|
1284
|
+
},
|
|
1285
|
+
"fifty_eighth" => {
|
|
1286
|
+
name: "fifty_eighth",
|
|
1287
|
+
description: "returns the fifty eighth item.",
|
|
1288
|
+
examples: [
|
|
1289
|
+
"(1..58).to_list.fifty_eighth",
|
|
1290
|
+
"(1..59).to_list.fifty_eighth",
|
|
1291
|
+
"[].fifty_eighth"
|
|
1292
|
+
]
|
|
1293
|
+
},
|
|
1294
|
+
"fifty_ninth" => {
|
|
1295
|
+
name: "fifty_ninth",
|
|
1296
|
+
description: "returns the fifty ninth item.",
|
|
1297
|
+
examples: [
|
|
1298
|
+
"(1..59).to_list.fifty_ninth",
|
|
1299
|
+
"(1..60).to_list.fifty_ninth",
|
|
1300
|
+
"[].fifty_ninth"
|
|
1301
|
+
]
|
|
1302
|
+
},
|
|
1303
|
+
"sixtieth" => {
|
|
1304
|
+
name: "sixtieth",
|
|
1305
|
+
description: "returns the sixtieth item.",
|
|
1306
|
+
examples: [
|
|
1307
|
+
"(1..60).to_list.sixtieth",
|
|
1308
|
+
"(1..61).to_list.sixtieth",
|
|
1309
|
+
"[].sixtieth"
|
|
1310
|
+
]
|
|
1311
|
+
},
|
|
1312
|
+
"sixty_first" => {
|
|
1313
|
+
name: "sixty_first",
|
|
1314
|
+
description: "returns the sixty first item.",
|
|
1315
|
+
examples: [
|
|
1316
|
+
"(1..61).to_list.sixty_first",
|
|
1317
|
+
"(1..62).to_list.sixty_first",
|
|
1318
|
+
"[].sixty_first"
|
|
1319
|
+
]
|
|
1320
|
+
},
|
|
1321
|
+
"sixty_second" => {
|
|
1322
|
+
name: "sixty_second",
|
|
1323
|
+
description: "returns the sixty second item.",
|
|
1324
|
+
examples: [
|
|
1325
|
+
"(1..62).to_list.sixty_second",
|
|
1326
|
+
"(1..63).to_list.sixty_second",
|
|
1327
|
+
"[].sixty_second"
|
|
1328
|
+
]
|
|
1329
|
+
},
|
|
1330
|
+
"sixty_third" => {
|
|
1331
|
+
name: "sixty_third",
|
|
1332
|
+
description: "returns the sixty third item.",
|
|
1333
|
+
examples: [
|
|
1334
|
+
"(1..63).to_list.sixty_third",
|
|
1335
|
+
"(1..64).to_list.sixty_third",
|
|
1336
|
+
"[].sixty_third"
|
|
1337
|
+
]
|
|
1338
|
+
},
|
|
1339
|
+
"sixty_fourth" => {
|
|
1340
|
+
name: "sixty_fourth",
|
|
1341
|
+
description: "returns the sixty fourth item.",
|
|
1342
|
+
examples: [
|
|
1343
|
+
"(1..64).to_list.sixty_fourth",
|
|
1344
|
+
"(1..65).to_list.sixty_fourth",
|
|
1345
|
+
"[].sixty_fourth"
|
|
1346
|
+
]
|
|
1347
|
+
},
|
|
1348
|
+
"sixty_fifth" => {
|
|
1349
|
+
name: "sixty_fifth",
|
|
1350
|
+
description: "returns the sixty fifth item.",
|
|
1351
|
+
examples: [
|
|
1352
|
+
"(1..65).to_list.sixty_fifth",
|
|
1353
|
+
"(1..66).to_list.sixty_fifth",
|
|
1354
|
+
"[].sixty_fifth"
|
|
1355
|
+
]
|
|
1356
|
+
},
|
|
1357
|
+
"sixty_sixth" => {
|
|
1358
|
+
name: "sixty_sixth",
|
|
1359
|
+
description: "returns the sixty sixth item.",
|
|
1360
|
+
examples: [
|
|
1361
|
+
"(1..66).to_list.sixty_sixth",
|
|
1362
|
+
"(1..67).to_list.sixty_sixth",
|
|
1363
|
+
"[].sixty_sixth"
|
|
1364
|
+
]
|
|
1365
|
+
},
|
|
1366
|
+
"sixty_seventh" => {
|
|
1367
|
+
name: "sixty_seventh",
|
|
1368
|
+
description: "returns the sixty seventh item.",
|
|
1369
|
+
examples: [
|
|
1370
|
+
"(1..67).to_list.sixty_seventh",
|
|
1371
|
+
"(1..68).to_list.sixty_seventh",
|
|
1372
|
+
"[].sixty_seventh"
|
|
1373
|
+
]
|
|
1374
|
+
},
|
|
1375
|
+
"sixty_eighth" => {
|
|
1376
|
+
name: "sixty_eighth",
|
|
1377
|
+
description: "returns the sixty eighth item.",
|
|
1378
|
+
examples: [
|
|
1379
|
+
"(1..68).to_list.sixty_eighth",
|
|
1380
|
+
"(1..69).to_list.sixty_eighth",
|
|
1381
|
+
"[].sixty_eighth"
|
|
1382
|
+
]
|
|
1383
|
+
},
|
|
1384
|
+
"sixty_ninth" => {
|
|
1385
|
+
name: "sixty_ninth",
|
|
1386
|
+
description: "returns the sixty ninth item.",
|
|
1387
|
+
examples: [
|
|
1388
|
+
"(1..69).to_list.sixty_ninth",
|
|
1389
|
+
"(1..70).to_list.sixty_ninth",
|
|
1390
|
+
"[].sixty_ninth"
|
|
1391
|
+
]
|
|
1392
|
+
},
|
|
1393
|
+
"seventieth" => {
|
|
1394
|
+
name: "seventieth",
|
|
1395
|
+
description: "returns the seventieth item.",
|
|
1396
|
+
examples: [
|
|
1397
|
+
"(1..70).to_list.seventieth",
|
|
1398
|
+
"(1..71).to_list.seventieth",
|
|
1399
|
+
"[].seventieth"
|
|
1400
|
+
]
|
|
1401
|
+
},
|
|
1402
|
+
"seventy_first" => {
|
|
1403
|
+
name: "seventy_first",
|
|
1404
|
+
description: "returns the seventy first item.",
|
|
1405
|
+
examples: [
|
|
1406
|
+
"(1..71).to_list.seventy_first",
|
|
1407
|
+
"(1..72).to_list.seventy_first",
|
|
1408
|
+
"[].seventy_first"
|
|
1409
|
+
]
|
|
1410
|
+
},
|
|
1411
|
+
"seventy_second" => {
|
|
1412
|
+
name: "seventy_second",
|
|
1413
|
+
description: "returns the seventy second item.",
|
|
1414
|
+
examples: [
|
|
1415
|
+
"(1..72).to_list.seventy_second",
|
|
1416
|
+
"(1..73).to_list.seventy_second",
|
|
1417
|
+
"[].seventy_second"
|
|
1418
|
+
]
|
|
1419
|
+
},
|
|
1420
|
+
"seventy_third" => {
|
|
1421
|
+
name: "seventy_third",
|
|
1422
|
+
description: "returns the seventy third item.",
|
|
1423
|
+
examples: [
|
|
1424
|
+
"(1..73).to_list.seventy_third",
|
|
1425
|
+
"(1..74).to_list.seventy_third",
|
|
1426
|
+
"[].seventy_third"
|
|
1427
|
+
]
|
|
1428
|
+
},
|
|
1429
|
+
"seventy_fourth" => {
|
|
1430
|
+
name: "seventy_fourth",
|
|
1431
|
+
description: "returns the seventy fourth item.",
|
|
1432
|
+
examples: [
|
|
1433
|
+
"(1..74).to_list.seventy_fourth",
|
|
1434
|
+
"(1..75).to_list.seventy_fourth",
|
|
1435
|
+
"[].seventy_fourth"
|
|
1436
|
+
]
|
|
1437
|
+
},
|
|
1438
|
+
"seventy_fifth" => {
|
|
1439
|
+
name: "seventy_fifth",
|
|
1440
|
+
description: "returns the seventy fifth item.",
|
|
1441
|
+
examples: [
|
|
1442
|
+
"(1..75).to_list.seventy_fifth",
|
|
1443
|
+
"(1..76).to_list.seventy_fifth",
|
|
1444
|
+
"[].seventy_fifth"
|
|
1445
|
+
]
|
|
1446
|
+
},
|
|
1447
|
+
"seventy_sixth" => {
|
|
1448
|
+
name: "seventy_sixth",
|
|
1449
|
+
description: "returns the seventy sixth item.",
|
|
1450
|
+
examples: [
|
|
1451
|
+
"(1..76).to_list.seventy_sixth",
|
|
1452
|
+
"(1..77).to_list.seventy_sixth",
|
|
1453
|
+
"[].seventy_sixth"
|
|
1454
|
+
]
|
|
1455
|
+
},
|
|
1456
|
+
"seventy_seventh" => {
|
|
1457
|
+
name: "seventy_seventh",
|
|
1458
|
+
description: "returns the seventy seventh item.",
|
|
1459
|
+
examples: [
|
|
1460
|
+
"(1..77).to_list.seventy_seventh",
|
|
1461
|
+
"(1..78).to_list.seventy_seventh",
|
|
1462
|
+
"[].seventy_seventh"
|
|
1463
|
+
]
|
|
1464
|
+
},
|
|
1465
|
+
"seventy_eighth" => {
|
|
1466
|
+
name: "seventy_eighth",
|
|
1467
|
+
description: "returns the seventy eighth item.",
|
|
1468
|
+
examples: [
|
|
1469
|
+
"(1..78).to_list.seventy_eighth",
|
|
1470
|
+
"(1..79).to_list.seventy_eighth",
|
|
1471
|
+
"[].seventy_eighth"
|
|
1472
|
+
]
|
|
1473
|
+
},
|
|
1474
|
+
"seventy_ninth" => {
|
|
1475
|
+
name: "seventy_ninth",
|
|
1476
|
+
description: "returns the seventy ninth item.",
|
|
1477
|
+
examples: [
|
|
1478
|
+
"(1..79).to_list.seventy_ninth",
|
|
1479
|
+
"(1..80).to_list.seventy_ninth",
|
|
1480
|
+
"[].seventy_ninth"
|
|
1481
|
+
]
|
|
1482
|
+
},
|
|
1483
|
+
"eightieth" => {
|
|
1484
|
+
name: "eightieth",
|
|
1485
|
+
description: "returns the eightieth item.",
|
|
1486
|
+
examples: [
|
|
1487
|
+
"(1..80).to_list.eightieth",
|
|
1488
|
+
"(1..81).to_list.eightieth",
|
|
1489
|
+
"[].eightieth"
|
|
1490
|
+
]
|
|
1491
|
+
},
|
|
1492
|
+
"eighty_first" => {
|
|
1493
|
+
name: "eighty_first",
|
|
1494
|
+
description: "returns the eighty first item.",
|
|
1495
|
+
examples: [
|
|
1496
|
+
"(1..81).to_list.eighty_first",
|
|
1497
|
+
"(1..82).to_list.eighty_first",
|
|
1498
|
+
"[].eighty_first"
|
|
1499
|
+
]
|
|
1500
|
+
},
|
|
1501
|
+
"eighty_second" => {
|
|
1502
|
+
name: "eighty_second",
|
|
1503
|
+
description: "returns the eighty second item.",
|
|
1504
|
+
examples: [
|
|
1505
|
+
"(1..82).to_list.eighty_second",
|
|
1506
|
+
"(1..83).to_list.eighty_second",
|
|
1507
|
+
"[].eighty_second"
|
|
1508
|
+
]
|
|
1509
|
+
},
|
|
1510
|
+
"eighty_third" => {
|
|
1511
|
+
name: "eighty_third",
|
|
1512
|
+
description: "returns the eighty third item.",
|
|
1513
|
+
examples: [
|
|
1514
|
+
"(1..83).to_list.eighty_third",
|
|
1515
|
+
"(1..84).to_list.eighty_third",
|
|
1516
|
+
"[].eighty_third"
|
|
1517
|
+
]
|
|
1518
|
+
},
|
|
1519
|
+
"eighty_fourth" => {
|
|
1520
|
+
name: "eighty_fourth",
|
|
1521
|
+
description: "returns the eighty fourth item.",
|
|
1522
|
+
examples: [
|
|
1523
|
+
"(1..84).to_list.eighty_fourth",
|
|
1524
|
+
"(1..85).to_list.eighty_fourth",
|
|
1525
|
+
"[].eighty_fourth"
|
|
1526
|
+
]
|
|
1527
|
+
},
|
|
1528
|
+
"eighty_fifth" => {
|
|
1529
|
+
name: "eighty_fifth",
|
|
1530
|
+
description: "returns the eighty fifth item.",
|
|
1531
|
+
examples: [
|
|
1532
|
+
"(1..85).to_list.eighty_fifth",
|
|
1533
|
+
"(1..86).to_list.eighty_fifth",
|
|
1534
|
+
"[].eighty_fifth"
|
|
1535
|
+
]
|
|
1536
|
+
},
|
|
1537
|
+
"eighty_sixth" => {
|
|
1538
|
+
name: "eighty_sixth",
|
|
1539
|
+
description: "returns the eighty sixth item.",
|
|
1540
|
+
examples: [
|
|
1541
|
+
"(1..86).to_list.eighty_sixth",
|
|
1542
|
+
"(1..87).to_list.eighty_sixth",
|
|
1543
|
+
"[].eighty_sixth"
|
|
1544
|
+
]
|
|
1545
|
+
},
|
|
1546
|
+
"eighty_seventh" => {
|
|
1547
|
+
name: "eighty_seventh",
|
|
1548
|
+
description: "returns the eighty seventh item.",
|
|
1549
|
+
examples: [
|
|
1550
|
+
"(1..87).to_list.eighty_seventh",
|
|
1551
|
+
"(1..88).to_list.eighty_seventh",
|
|
1552
|
+
"[].eighty_seventh"
|
|
1553
|
+
]
|
|
1554
|
+
},
|
|
1555
|
+
"eighty_eighth" => {
|
|
1556
|
+
name: "eighty_eighth",
|
|
1557
|
+
description: "returns the eighty eighth item.",
|
|
1558
|
+
examples: [
|
|
1559
|
+
"(1..88).to_list.eighty_eighth",
|
|
1560
|
+
"(1..89).to_list.eighty_eighth",
|
|
1561
|
+
"[].eighty_eighth"
|
|
1562
|
+
]
|
|
1563
|
+
},
|
|
1564
|
+
"eighty_ninth" => {
|
|
1565
|
+
name: "eighty_ninth",
|
|
1566
|
+
description: "returns the eighty ninth item.",
|
|
1567
|
+
examples: [
|
|
1568
|
+
"(1..89).to_list.eighty_ninth",
|
|
1569
|
+
"(1..90).to_list.eighty_ninth",
|
|
1570
|
+
"[].eighty_ninth"
|
|
1571
|
+
]
|
|
1572
|
+
},
|
|
1573
|
+
"ninetieth" => {
|
|
1574
|
+
name: "ninetieth",
|
|
1575
|
+
description: "returns the ninetieth item.",
|
|
1576
|
+
examples: [
|
|
1577
|
+
"(1..90).to_list.ninetieth",
|
|
1578
|
+
"(1..91).to_list.ninetieth",
|
|
1579
|
+
"[].ninetieth"
|
|
1580
|
+
]
|
|
1581
|
+
},
|
|
1582
|
+
"ninety_first" => {
|
|
1583
|
+
name: "ninety_first",
|
|
1584
|
+
description: "returns the ninety first item.",
|
|
1585
|
+
examples: [
|
|
1586
|
+
"(1..91).to_list.ninety_first",
|
|
1587
|
+
"(1..92).to_list.ninety_first",
|
|
1588
|
+
"[].ninety_first"
|
|
1589
|
+
]
|
|
1590
|
+
},
|
|
1591
|
+
"ninety_second" => {
|
|
1592
|
+
name: "ninety_second",
|
|
1593
|
+
description: "returns the ninety second item.",
|
|
1594
|
+
examples: [
|
|
1595
|
+
"(1..92).to_list.ninety_second",
|
|
1596
|
+
"(1..93).to_list.ninety_second",
|
|
1597
|
+
"[].ninety_second"
|
|
1598
|
+
]
|
|
1599
|
+
},
|
|
1600
|
+
"ninety_third" => {
|
|
1601
|
+
name: "ninety_third",
|
|
1602
|
+
description: "returns the ninety third item.",
|
|
1603
|
+
examples: [
|
|
1604
|
+
"(1..93).to_list.ninety_third",
|
|
1605
|
+
"(1..94).to_list.ninety_third",
|
|
1606
|
+
"[].ninety_third"
|
|
1607
|
+
]
|
|
1608
|
+
},
|
|
1609
|
+
"ninety_fourth" => {
|
|
1610
|
+
name: "ninety_fourth",
|
|
1611
|
+
description: "returns the ninety fourth item.",
|
|
1612
|
+
examples: [
|
|
1613
|
+
"(1..94).to_list.ninety_fourth",
|
|
1614
|
+
"(1..95).to_list.ninety_fourth",
|
|
1615
|
+
"[].ninety_fourth"
|
|
1616
|
+
]
|
|
1617
|
+
},
|
|
1618
|
+
"ninety_fifth" => {
|
|
1619
|
+
name: "ninety_fifth",
|
|
1620
|
+
description: "returns the ninety fifth item.",
|
|
1621
|
+
examples: [
|
|
1622
|
+
"(1..95).to_list.ninety_fifth",
|
|
1623
|
+
"(1..96).to_list.ninety_fifth",
|
|
1624
|
+
"[].ninety_fifth"
|
|
1625
|
+
]
|
|
1626
|
+
},
|
|
1627
|
+
"ninety_sixth" => {
|
|
1628
|
+
name: "ninety_sixth",
|
|
1629
|
+
description: "returns the ninety sixth item.",
|
|
1630
|
+
examples: [
|
|
1631
|
+
"(1..96).to_list.ninety_sixth",
|
|
1632
|
+
"(1..97).to_list.ninety_sixth",
|
|
1633
|
+
"[].ninety_sixth"
|
|
1634
|
+
]
|
|
1635
|
+
},
|
|
1636
|
+
"ninety_seventh" => {
|
|
1637
|
+
name: "ninety_seventh",
|
|
1638
|
+
description: "returns the ninety seventh item.",
|
|
1639
|
+
examples: [
|
|
1640
|
+
"(1..97).to_list.ninety_seventh",
|
|
1641
|
+
"(1..98).to_list.ninety_seventh",
|
|
1642
|
+
"[].ninety_seventh"
|
|
1643
|
+
]
|
|
1644
|
+
},
|
|
1645
|
+
"ninety_eighth" => {
|
|
1646
|
+
name: "ninety_eighth",
|
|
1647
|
+
description: "returns the ninety eighth item.",
|
|
1648
|
+
examples: [
|
|
1649
|
+
"(1..98).to_list.ninety_eighth",
|
|
1650
|
+
"(1..99).to_list.ninety_eighth",
|
|
1651
|
+
"[].ninety_eighth"
|
|
1652
|
+
]
|
|
1653
|
+
},
|
|
1654
|
+
"ninety_ninth" => {
|
|
1655
|
+
name: "ninety_ninth",
|
|
1656
|
+
description: "returns the ninety ninth item.",
|
|
1657
|
+
examples: [
|
|
1658
|
+
"(1..99).to_list.ninety_ninth",
|
|
1659
|
+
"(1..100).to_list.ninety_ninth",
|
|
1660
|
+
"[].ninety_ninth"
|
|
1661
|
+
]
|
|
1662
|
+
},
|
|
1663
|
+
"one_hundredth" => {
|
|
1664
|
+
name: "one_hundredth",
|
|
1665
|
+
description: "returns the one hundredth item.",
|
|
1666
|
+
examples: [
|
|
1667
|
+
"(1..100).to_list.one_hundredth",
|
|
1668
|
+
"(1..101).to_list.one_hundredth",
|
|
1669
|
+
"[].one_hundredth"
|
|
1670
|
+
]
|
|
1671
|
+
},
|
|
1672
|
+
"many?" => {
|
|
1673
|
+
name: "many?",
|
|
1674
|
+
description: "returns whether the list has more than one item.",
|
|
1675
|
+
examples: ["[1, 2].many?", "[1].many?", "[].many?"]
|
|
1676
|
+
},
|
|
1677
|
+
"positive?" => {
|
|
1678
|
+
name: "positive?",
|
|
1679
|
+
description: "returns whether the list size is positive.",
|
|
1680
|
+
examples: ["[1].positive?", "[].positive?", "[1, 2].positive?"]
|
|
1681
|
+
},
|
|
1682
|
+
"negative?" => {
|
|
1683
|
+
name: "negative?",
|
|
1684
|
+
description: "returns whether the list size is negative.",
|
|
1685
|
+
examples: ["[].negative?", "[1].negative?", "[1, 2].negative?"]
|
|
1686
|
+
},
|
|
1687
|
+
"zero?" => {
|
|
1688
|
+
name: "zero?",
|
|
1689
|
+
description: "returns whether the list size is zero.",
|
|
1690
|
+
examples: ["(1..0).to_list.zero?", "(1..1).to_list.zero?", "[].zero?"]
|
|
1691
|
+
},
|
|
1692
|
+
"one?" => {
|
|
1693
|
+
name: "one?",
|
|
1694
|
+
description: "returns whether the list size is one.",
|
|
1695
|
+
examples: ["(1..1).to_list.one?", "(1..2).to_list.one?", "[].one?"]
|
|
1696
|
+
},
|
|
1697
|
+
"two?" => {
|
|
1698
|
+
name: "two?",
|
|
1699
|
+
description: "returns whether the list size is two.",
|
|
1700
|
+
examples: ["(1..2).to_list.two?", "(1..3).to_list.two?", "[].two?"]
|
|
1701
|
+
},
|
|
1702
|
+
"three?" => {
|
|
1703
|
+
name: "three?",
|
|
1704
|
+
description: "returns whether the list size is three.",
|
|
1705
|
+
examples: [
|
|
1706
|
+
"(1..3).to_list.three?",
|
|
1707
|
+
"(1..4).to_list.three?",
|
|
1708
|
+
"[].three?"
|
|
1709
|
+
]
|
|
1710
|
+
},
|
|
1711
|
+
"four?" => {
|
|
1712
|
+
name: "four?",
|
|
1713
|
+
description: "returns whether the list size is four.",
|
|
1714
|
+
examples: ["(1..4).to_list.four?", "(1..5).to_list.four?", "[].four?"]
|
|
1715
|
+
},
|
|
1716
|
+
"five?" => {
|
|
1717
|
+
name: "five?",
|
|
1718
|
+
description: "returns whether the list size is five.",
|
|
1719
|
+
examples: ["(1..5).to_list.five?", "(1..6).to_list.five?", "[].five?"]
|
|
1720
|
+
},
|
|
1721
|
+
"six?" => {
|
|
1722
|
+
name: "six?",
|
|
1723
|
+
description: "returns whether the list size is six.",
|
|
1724
|
+
examples: ["(1..6).to_list.six?", "(1..7).to_list.six?", "[].six?"]
|
|
1725
|
+
},
|
|
1726
|
+
"seven?" => {
|
|
1727
|
+
name: "seven?",
|
|
1728
|
+
description: "returns whether the list size is seven.",
|
|
1729
|
+
examples: [
|
|
1730
|
+
"(1..7).to_list.seven?",
|
|
1731
|
+
"(1..8).to_list.seven?",
|
|
1732
|
+
"[].seven?"
|
|
1733
|
+
]
|
|
1734
|
+
},
|
|
1735
|
+
"eight?" => {
|
|
1736
|
+
name: "eight?",
|
|
1737
|
+
description: "returns whether the list size is eight.",
|
|
1738
|
+
examples: [
|
|
1739
|
+
"(1..8).to_list.eight?",
|
|
1740
|
+
"(1..9).to_list.eight?",
|
|
1741
|
+
"[].eight?"
|
|
1742
|
+
]
|
|
1743
|
+
},
|
|
1744
|
+
"nine?" => {
|
|
1745
|
+
name: "nine?",
|
|
1746
|
+
description: "returns whether the list size is nine.",
|
|
1747
|
+
examples: [
|
|
1748
|
+
"(1..9).to_list.nine?",
|
|
1749
|
+
"(1..10).to_list.nine?",
|
|
1750
|
+
"[].nine?"
|
|
1751
|
+
]
|
|
1752
|
+
},
|
|
1753
|
+
"ten?" => {
|
|
1754
|
+
name: "ten?",
|
|
1755
|
+
description: "returns whether the list size is ten.",
|
|
1756
|
+
examples: ["(1..10).to_list.ten?", "(1..11).to_list.ten?", "[].ten?"]
|
|
1757
|
+
},
|
|
1758
|
+
"eleven?" => {
|
|
1759
|
+
name: "eleven?",
|
|
1760
|
+
description: "returns whether the list size is eleven.",
|
|
1761
|
+
examples: [
|
|
1762
|
+
"(1..11).to_list.eleven?",
|
|
1763
|
+
"(1..12).to_list.eleven?",
|
|
1764
|
+
"[].eleven?"
|
|
1765
|
+
]
|
|
1766
|
+
},
|
|
1767
|
+
"twelve?" => {
|
|
1768
|
+
name: "twelve?",
|
|
1769
|
+
description: "returns whether the list size is twelve.",
|
|
1770
|
+
examples: [
|
|
1771
|
+
"(1..12).to_list.twelve?",
|
|
1772
|
+
"(1..13).to_list.twelve?",
|
|
1773
|
+
"[].twelve?"
|
|
1774
|
+
]
|
|
1775
|
+
},
|
|
1776
|
+
"thirteen?" => {
|
|
1777
|
+
name: "thirteen?",
|
|
1778
|
+
description: "returns whether the list size is thirteen.",
|
|
1779
|
+
examples: [
|
|
1780
|
+
"(1..13).to_list.thirteen?",
|
|
1781
|
+
"(1..14).to_list.thirteen?",
|
|
1782
|
+
"[].thirteen?"
|
|
1783
|
+
]
|
|
1784
|
+
},
|
|
1785
|
+
"fourteen?" => {
|
|
1786
|
+
name: "fourteen?",
|
|
1787
|
+
description: "returns whether the list size is fourteen.",
|
|
1788
|
+
examples: [
|
|
1789
|
+
"(1..14).to_list.fourteen?",
|
|
1790
|
+
"(1..15).to_list.fourteen?",
|
|
1791
|
+
"[].fourteen?"
|
|
1792
|
+
]
|
|
1793
|
+
},
|
|
1794
|
+
"fifteen?" => {
|
|
1795
|
+
name: "fifteen?",
|
|
1796
|
+
description: "returns whether the list size is fifteen.",
|
|
1797
|
+
examples: [
|
|
1798
|
+
"(1..15).to_list.fifteen?",
|
|
1799
|
+
"(1..16).to_list.fifteen?",
|
|
1800
|
+
"[].fifteen?"
|
|
1801
|
+
]
|
|
1802
|
+
},
|
|
1803
|
+
"sixteen?" => {
|
|
1804
|
+
name: "sixteen?",
|
|
1805
|
+
description: "returns whether the list size is sixteen.",
|
|
1806
|
+
examples: [
|
|
1807
|
+
"(1..16).to_list.sixteen?",
|
|
1808
|
+
"(1..17).to_list.sixteen?",
|
|
1809
|
+
"[].sixteen?"
|
|
1810
|
+
]
|
|
1811
|
+
},
|
|
1812
|
+
"seventeen?" => {
|
|
1813
|
+
name: "seventeen?",
|
|
1814
|
+
description: "returns whether the list size is seventeen.",
|
|
1815
|
+
examples: [
|
|
1816
|
+
"(1..17).to_list.seventeen?",
|
|
1817
|
+
"(1..18).to_list.seventeen?",
|
|
1818
|
+
"[].seventeen?"
|
|
1819
|
+
]
|
|
1820
|
+
},
|
|
1821
|
+
"eighteen?" => {
|
|
1822
|
+
name: "eighteen?",
|
|
1823
|
+
description: "returns whether the list size is eighteen.",
|
|
1824
|
+
examples: [
|
|
1825
|
+
"(1..18).to_list.eighteen?",
|
|
1826
|
+
"(1..19).to_list.eighteen?",
|
|
1827
|
+
"[].eighteen?"
|
|
1828
|
+
]
|
|
1829
|
+
},
|
|
1830
|
+
"nineteen?" => {
|
|
1831
|
+
name: "nineteen?",
|
|
1832
|
+
description: "returns whether the list size is nineteen.",
|
|
1833
|
+
examples: [
|
|
1834
|
+
"(1..19).to_list.nineteen?",
|
|
1835
|
+
"(1..20).to_list.nineteen?",
|
|
1836
|
+
"[].nineteen?"
|
|
1837
|
+
]
|
|
1838
|
+
},
|
|
1839
|
+
"twenty?" => {
|
|
1840
|
+
name: "twenty?",
|
|
1841
|
+
description: "returns whether the list size is twenty.",
|
|
1842
|
+
examples: [
|
|
1843
|
+
"(1..20).to_list.twenty?",
|
|
1844
|
+
"(1..21).to_list.twenty?",
|
|
1845
|
+
"[].twenty?"
|
|
1846
|
+
]
|
|
1847
|
+
},
|
|
1848
|
+
"twenty_one?" => {
|
|
1849
|
+
name: "twenty_one?",
|
|
1850
|
+
description: "returns whether the list size is twenty one.",
|
|
1851
|
+
examples: [
|
|
1852
|
+
"(1..21).to_list.twenty_one?",
|
|
1853
|
+
"(1..22).to_list.twenty_one?",
|
|
1854
|
+
"[].twenty_one?"
|
|
1855
|
+
]
|
|
1856
|
+
},
|
|
1857
|
+
"twenty_two?" => {
|
|
1858
|
+
name: "twenty_two?",
|
|
1859
|
+
description: "returns whether the list size is twenty two.",
|
|
1860
|
+
examples: [
|
|
1861
|
+
"(1..22).to_list.twenty_two?",
|
|
1862
|
+
"(1..23).to_list.twenty_two?",
|
|
1863
|
+
"[].twenty_two?"
|
|
1864
|
+
]
|
|
1865
|
+
},
|
|
1866
|
+
"twenty_three?" => {
|
|
1867
|
+
name: "twenty_three?",
|
|
1868
|
+
description: "returns whether the list size is twenty three.",
|
|
1869
|
+
examples: [
|
|
1870
|
+
"(1..23).to_list.twenty_three?",
|
|
1871
|
+
"(1..24).to_list.twenty_three?",
|
|
1872
|
+
"[].twenty_three?"
|
|
1873
|
+
]
|
|
1874
|
+
},
|
|
1875
|
+
"twenty_four?" => {
|
|
1876
|
+
name: "twenty_four?",
|
|
1877
|
+
description: "returns whether the list size is twenty four.",
|
|
1878
|
+
examples: [
|
|
1879
|
+
"(1..24).to_list.twenty_four?",
|
|
1880
|
+
"(1..25).to_list.twenty_four?",
|
|
1881
|
+
"[].twenty_four?"
|
|
1882
|
+
]
|
|
1883
|
+
},
|
|
1884
|
+
"twenty_five?" => {
|
|
1885
|
+
name: "twenty_five?",
|
|
1886
|
+
description: "returns whether the list size is twenty five.",
|
|
1887
|
+
examples: [
|
|
1888
|
+
"(1..25).to_list.twenty_five?",
|
|
1889
|
+
"(1..26).to_list.twenty_five?",
|
|
1890
|
+
"[].twenty_five?"
|
|
1891
|
+
]
|
|
1892
|
+
},
|
|
1893
|
+
"twenty_six?" => {
|
|
1894
|
+
name: "twenty_six?",
|
|
1895
|
+
description: "returns whether the list size is twenty six.",
|
|
1896
|
+
examples: [
|
|
1897
|
+
"(1..26).to_list.twenty_six?",
|
|
1898
|
+
"(1..27).to_list.twenty_six?",
|
|
1899
|
+
"[].twenty_six?"
|
|
1900
|
+
]
|
|
1901
|
+
},
|
|
1902
|
+
"twenty_seven?" => {
|
|
1903
|
+
name: "twenty_seven?",
|
|
1904
|
+
description: "returns whether the list size is twenty seven.",
|
|
1905
|
+
examples: [
|
|
1906
|
+
"(1..27).to_list.twenty_seven?",
|
|
1907
|
+
"(1..28).to_list.twenty_seven?",
|
|
1908
|
+
"[].twenty_seven?"
|
|
1909
|
+
]
|
|
1910
|
+
},
|
|
1911
|
+
"twenty_eight?" => {
|
|
1912
|
+
name: "twenty_eight?",
|
|
1913
|
+
description: "returns whether the list size is twenty eight.",
|
|
1914
|
+
examples: [
|
|
1915
|
+
"(1..28).to_list.twenty_eight?",
|
|
1916
|
+
"(1..29).to_list.twenty_eight?",
|
|
1917
|
+
"[].twenty_eight?"
|
|
1918
|
+
]
|
|
1919
|
+
},
|
|
1920
|
+
"twenty_nine?" => {
|
|
1921
|
+
name: "twenty_nine?",
|
|
1922
|
+
description: "returns whether the list size is twenty nine.",
|
|
1923
|
+
examples: [
|
|
1924
|
+
"(1..29).to_list.twenty_nine?",
|
|
1925
|
+
"(1..30).to_list.twenty_nine?",
|
|
1926
|
+
"[].twenty_nine?"
|
|
1927
|
+
]
|
|
1928
|
+
},
|
|
1929
|
+
"thirty?" => {
|
|
1930
|
+
name: "thirty?",
|
|
1931
|
+
description: "returns whether the list size is thirty.",
|
|
1932
|
+
examples: [
|
|
1933
|
+
"(1..30).to_list.thirty?",
|
|
1934
|
+
"(1..31).to_list.thirty?",
|
|
1935
|
+
"[].thirty?"
|
|
1936
|
+
]
|
|
1937
|
+
},
|
|
1938
|
+
"thirty_one?" => {
|
|
1939
|
+
name: "thirty_one?",
|
|
1940
|
+
description: "returns whether the list size is thirty one.",
|
|
1941
|
+
examples: [
|
|
1942
|
+
"(1..31).to_list.thirty_one?",
|
|
1943
|
+
"(1..32).to_list.thirty_one?",
|
|
1944
|
+
"[].thirty_one?"
|
|
1945
|
+
]
|
|
1946
|
+
},
|
|
1947
|
+
"thirty_two?" => {
|
|
1948
|
+
name: "thirty_two?",
|
|
1949
|
+
description: "returns whether the list size is thirty two.",
|
|
1950
|
+
examples: [
|
|
1951
|
+
"(1..32).to_list.thirty_two?",
|
|
1952
|
+
"(1..33).to_list.thirty_two?",
|
|
1953
|
+
"[].thirty_two?"
|
|
1954
|
+
]
|
|
1955
|
+
},
|
|
1956
|
+
"thirty_three?" => {
|
|
1957
|
+
name: "thirty_three?",
|
|
1958
|
+
description: "returns whether the list size is thirty three.",
|
|
1959
|
+
examples: [
|
|
1960
|
+
"(1..33).to_list.thirty_three?",
|
|
1961
|
+
"(1..34).to_list.thirty_three?",
|
|
1962
|
+
"[].thirty_three?"
|
|
1963
|
+
]
|
|
1964
|
+
},
|
|
1965
|
+
"thirty_four?" => {
|
|
1966
|
+
name: "thirty_four?",
|
|
1967
|
+
description: "returns whether the list size is thirty four.",
|
|
1968
|
+
examples: [
|
|
1969
|
+
"(1..34).to_list.thirty_four?",
|
|
1970
|
+
"(1..35).to_list.thirty_four?",
|
|
1971
|
+
"[].thirty_four?"
|
|
1972
|
+
]
|
|
1973
|
+
},
|
|
1974
|
+
"thirty_five?" => {
|
|
1975
|
+
name: "thirty_five?",
|
|
1976
|
+
description: "returns whether the list size is thirty five.",
|
|
1977
|
+
examples: [
|
|
1978
|
+
"(1..35).to_list.thirty_five?",
|
|
1979
|
+
"(1..36).to_list.thirty_five?",
|
|
1980
|
+
"[].thirty_five?"
|
|
1981
|
+
]
|
|
1982
|
+
},
|
|
1983
|
+
"thirty_six?" => {
|
|
1984
|
+
name: "thirty_six?",
|
|
1985
|
+
description: "returns whether the list size is thirty six.",
|
|
1986
|
+
examples: [
|
|
1987
|
+
"(1..36).to_list.thirty_six?",
|
|
1988
|
+
"(1..37).to_list.thirty_six?",
|
|
1989
|
+
"[].thirty_six?"
|
|
1990
|
+
]
|
|
1991
|
+
},
|
|
1992
|
+
"thirty_seven?" => {
|
|
1993
|
+
name: "thirty_seven?",
|
|
1994
|
+
description: "returns whether the list size is thirty seven.",
|
|
1995
|
+
examples: [
|
|
1996
|
+
"(1..37).to_list.thirty_seven?",
|
|
1997
|
+
"(1..38).to_list.thirty_seven?",
|
|
1998
|
+
"[].thirty_seven?"
|
|
1999
|
+
]
|
|
2000
|
+
},
|
|
2001
|
+
"thirty_eight?" => {
|
|
2002
|
+
name: "thirty_eight?",
|
|
2003
|
+
description: "returns whether the list size is thirty eight.",
|
|
2004
|
+
examples: [
|
|
2005
|
+
"(1..38).to_list.thirty_eight?",
|
|
2006
|
+
"(1..39).to_list.thirty_eight?",
|
|
2007
|
+
"[].thirty_eight?"
|
|
2008
|
+
]
|
|
2009
|
+
},
|
|
2010
|
+
"thirty_nine?" => {
|
|
2011
|
+
name: "thirty_nine?",
|
|
2012
|
+
description: "returns whether the list size is thirty nine.",
|
|
2013
|
+
examples: [
|
|
2014
|
+
"(1..39).to_list.thirty_nine?",
|
|
2015
|
+
"(1..40).to_list.thirty_nine?",
|
|
2016
|
+
"[].thirty_nine?"
|
|
2017
|
+
]
|
|
2018
|
+
},
|
|
2019
|
+
"forty?" => {
|
|
2020
|
+
name: "forty?",
|
|
2021
|
+
description: "returns whether the list size is forty.",
|
|
2022
|
+
examples: [
|
|
2023
|
+
"(1..40).to_list.forty?",
|
|
2024
|
+
"(1..41).to_list.forty?",
|
|
2025
|
+
"[].forty?"
|
|
2026
|
+
]
|
|
2027
|
+
},
|
|
2028
|
+
"forty_one?" => {
|
|
2029
|
+
name: "forty_one?",
|
|
2030
|
+
description: "returns whether the list size is forty one.",
|
|
2031
|
+
examples: [
|
|
2032
|
+
"(1..41).to_list.forty_one?",
|
|
2033
|
+
"(1..42).to_list.forty_one?",
|
|
2034
|
+
"[].forty_one?"
|
|
2035
|
+
]
|
|
2036
|
+
},
|
|
2037
|
+
"forty_two?" => {
|
|
2038
|
+
name: "forty_two?",
|
|
2039
|
+
description: "returns whether the list size is forty two.",
|
|
2040
|
+
examples: [
|
|
2041
|
+
"(1..42).to_list.forty_two?",
|
|
2042
|
+
"(1..43).to_list.forty_two?",
|
|
2043
|
+
"[].forty_two?"
|
|
2044
|
+
]
|
|
2045
|
+
},
|
|
2046
|
+
"forty_three?" => {
|
|
2047
|
+
name: "forty_three?",
|
|
2048
|
+
description: "returns whether the list size is forty three.",
|
|
2049
|
+
examples: [
|
|
2050
|
+
"(1..43).to_list.forty_three?",
|
|
2051
|
+
"(1..44).to_list.forty_three?",
|
|
2052
|
+
"[].forty_three?"
|
|
2053
|
+
]
|
|
2054
|
+
},
|
|
2055
|
+
"forty_four?" => {
|
|
2056
|
+
name: "forty_four?",
|
|
2057
|
+
description: "returns whether the list size is forty four.",
|
|
2058
|
+
examples: [
|
|
2059
|
+
"(1..44).to_list.forty_four?",
|
|
2060
|
+
"(1..45).to_list.forty_four?",
|
|
2061
|
+
"[].forty_four?"
|
|
2062
|
+
]
|
|
2063
|
+
},
|
|
2064
|
+
"forty_five?" => {
|
|
2065
|
+
name: "forty_five?",
|
|
2066
|
+
description: "returns whether the list size is forty five.",
|
|
2067
|
+
examples: [
|
|
2068
|
+
"(1..45).to_list.forty_five?",
|
|
2069
|
+
"(1..46).to_list.forty_five?",
|
|
2070
|
+
"[].forty_five?"
|
|
2071
|
+
]
|
|
2072
|
+
},
|
|
2073
|
+
"forty_six?" => {
|
|
2074
|
+
name: "forty_six?",
|
|
2075
|
+
description: "returns whether the list size is forty six.",
|
|
2076
|
+
examples: [
|
|
2077
|
+
"(1..46).to_list.forty_six?",
|
|
2078
|
+
"(1..47).to_list.forty_six?",
|
|
2079
|
+
"[].forty_six?"
|
|
2080
|
+
]
|
|
2081
|
+
},
|
|
2082
|
+
"forty_seven?" => {
|
|
2083
|
+
name: "forty_seven?",
|
|
2084
|
+
description: "returns whether the list size is forty seven.",
|
|
2085
|
+
examples: [
|
|
2086
|
+
"(1..47).to_list.forty_seven?",
|
|
2087
|
+
"(1..48).to_list.forty_seven?",
|
|
2088
|
+
"[].forty_seven?"
|
|
2089
|
+
]
|
|
2090
|
+
},
|
|
2091
|
+
"forty_eight?" => {
|
|
2092
|
+
name: "forty_eight?",
|
|
2093
|
+
description: "returns whether the list size is forty eight.",
|
|
2094
|
+
examples: [
|
|
2095
|
+
"(1..48).to_list.forty_eight?",
|
|
2096
|
+
"(1..49).to_list.forty_eight?",
|
|
2097
|
+
"[].forty_eight?"
|
|
2098
|
+
]
|
|
2099
|
+
},
|
|
2100
|
+
"forty_nine?" => {
|
|
2101
|
+
name: "forty_nine?",
|
|
2102
|
+
description: "returns whether the list size is forty nine.",
|
|
2103
|
+
examples: [
|
|
2104
|
+
"(1..49).to_list.forty_nine?",
|
|
2105
|
+
"(1..50).to_list.forty_nine?",
|
|
2106
|
+
"[].forty_nine?"
|
|
2107
|
+
]
|
|
2108
|
+
},
|
|
2109
|
+
"fifty?" => {
|
|
2110
|
+
name: "fifty?",
|
|
2111
|
+
description: "returns whether the list size is fifty.",
|
|
2112
|
+
examples: [
|
|
2113
|
+
"(1..50).to_list.fifty?",
|
|
2114
|
+
"(1..51).to_list.fifty?",
|
|
2115
|
+
"[].fifty?"
|
|
2116
|
+
]
|
|
2117
|
+
},
|
|
2118
|
+
"fifty_one?" => {
|
|
2119
|
+
name: "fifty_one?",
|
|
2120
|
+
description: "returns whether the list size is fifty one.",
|
|
2121
|
+
examples: [
|
|
2122
|
+
"(1..51).to_list.fifty_one?",
|
|
2123
|
+
"(1..52).to_list.fifty_one?",
|
|
2124
|
+
"[].fifty_one?"
|
|
2125
|
+
]
|
|
2126
|
+
},
|
|
2127
|
+
"fifty_two?" => {
|
|
2128
|
+
name: "fifty_two?",
|
|
2129
|
+
description: "returns whether the list size is fifty two.",
|
|
2130
|
+
examples: [
|
|
2131
|
+
"(1..52).to_list.fifty_two?",
|
|
2132
|
+
"(1..53).to_list.fifty_two?",
|
|
2133
|
+
"[].fifty_two?"
|
|
2134
|
+
]
|
|
2135
|
+
},
|
|
2136
|
+
"fifty_three?" => {
|
|
2137
|
+
name: "fifty_three?",
|
|
2138
|
+
description: "returns whether the list size is fifty three.",
|
|
2139
|
+
examples: [
|
|
2140
|
+
"(1..53).to_list.fifty_three?",
|
|
2141
|
+
"(1..54).to_list.fifty_three?",
|
|
2142
|
+
"[].fifty_three?"
|
|
2143
|
+
]
|
|
2144
|
+
},
|
|
2145
|
+
"fifty_four?" => {
|
|
2146
|
+
name: "fifty_four?",
|
|
2147
|
+
description: "returns whether the list size is fifty four.",
|
|
2148
|
+
examples: [
|
|
2149
|
+
"(1..54).to_list.fifty_four?",
|
|
2150
|
+
"(1..55).to_list.fifty_four?",
|
|
2151
|
+
"[].fifty_four?"
|
|
2152
|
+
]
|
|
2153
|
+
},
|
|
2154
|
+
"fifty_five?" => {
|
|
2155
|
+
name: "fifty_five?",
|
|
2156
|
+
description: "returns whether the list size is fifty five.",
|
|
2157
|
+
examples: [
|
|
2158
|
+
"(1..55).to_list.fifty_five?",
|
|
2159
|
+
"(1..56).to_list.fifty_five?",
|
|
2160
|
+
"[].fifty_five?"
|
|
2161
|
+
]
|
|
2162
|
+
},
|
|
2163
|
+
"fifty_six?" => {
|
|
2164
|
+
name: "fifty_six?",
|
|
2165
|
+
description: "returns whether the list size is fifty six.",
|
|
2166
|
+
examples: [
|
|
2167
|
+
"(1..56).to_list.fifty_six?",
|
|
2168
|
+
"(1..57).to_list.fifty_six?",
|
|
2169
|
+
"[].fifty_six?"
|
|
2170
|
+
]
|
|
2171
|
+
},
|
|
2172
|
+
"fifty_seven?" => {
|
|
2173
|
+
name: "fifty_seven?",
|
|
2174
|
+
description: "returns whether the list size is fifty seven.",
|
|
2175
|
+
examples: [
|
|
2176
|
+
"(1..57).to_list.fifty_seven?",
|
|
2177
|
+
"(1..58).to_list.fifty_seven?",
|
|
2178
|
+
"[].fifty_seven?"
|
|
2179
|
+
]
|
|
2180
|
+
},
|
|
2181
|
+
"fifty_eight?" => {
|
|
2182
|
+
name: "fifty_eight?",
|
|
2183
|
+
description: "returns whether the list size is fifty eight.",
|
|
2184
|
+
examples: [
|
|
2185
|
+
"(1..58).to_list.fifty_eight?",
|
|
2186
|
+
"(1..59).to_list.fifty_eight?",
|
|
2187
|
+
"[].fifty_eight?"
|
|
2188
|
+
]
|
|
2189
|
+
},
|
|
2190
|
+
"fifty_nine?" => {
|
|
2191
|
+
name: "fifty_nine?",
|
|
2192
|
+
description: "returns whether the list size is fifty nine.",
|
|
2193
|
+
examples: [
|
|
2194
|
+
"(1..59).to_list.fifty_nine?",
|
|
2195
|
+
"(1..60).to_list.fifty_nine?",
|
|
2196
|
+
"[].fifty_nine?"
|
|
2197
|
+
]
|
|
2198
|
+
},
|
|
2199
|
+
"sixty?" => {
|
|
2200
|
+
name: "sixty?",
|
|
2201
|
+
description: "returns whether the list size is sixty.",
|
|
2202
|
+
examples: [
|
|
2203
|
+
"(1..60).to_list.sixty?",
|
|
2204
|
+
"(1..61).to_list.sixty?",
|
|
2205
|
+
"[].sixty?"
|
|
2206
|
+
]
|
|
2207
|
+
},
|
|
2208
|
+
"sixty_one?" => {
|
|
2209
|
+
name: "sixty_one?",
|
|
2210
|
+
description: "returns whether the list size is sixty one.",
|
|
2211
|
+
examples: [
|
|
2212
|
+
"(1..61).to_list.sixty_one?",
|
|
2213
|
+
"(1..62).to_list.sixty_one?",
|
|
2214
|
+
"[].sixty_one?"
|
|
2215
|
+
]
|
|
2216
|
+
},
|
|
2217
|
+
"sixty_two?" => {
|
|
2218
|
+
name: "sixty_two?",
|
|
2219
|
+
description: "returns whether the list size is sixty two.",
|
|
2220
|
+
examples: [
|
|
2221
|
+
"(1..62).to_list.sixty_two?",
|
|
2222
|
+
"(1..63).to_list.sixty_two?",
|
|
2223
|
+
"[].sixty_two?"
|
|
2224
|
+
]
|
|
2225
|
+
},
|
|
2226
|
+
"sixty_three?" => {
|
|
2227
|
+
name: "sixty_three?",
|
|
2228
|
+
description: "returns whether the list size is sixty three.",
|
|
2229
|
+
examples: [
|
|
2230
|
+
"(1..63).to_list.sixty_three?",
|
|
2231
|
+
"(1..64).to_list.sixty_three?",
|
|
2232
|
+
"[].sixty_three?"
|
|
2233
|
+
]
|
|
2234
|
+
},
|
|
2235
|
+
"sixty_four?" => {
|
|
2236
|
+
name: "sixty_four?",
|
|
2237
|
+
description: "returns whether the list size is sixty four.",
|
|
2238
|
+
examples: [
|
|
2239
|
+
"(1..64).to_list.sixty_four?",
|
|
2240
|
+
"(1..65).to_list.sixty_four?",
|
|
2241
|
+
"[].sixty_four?"
|
|
2242
|
+
]
|
|
2243
|
+
},
|
|
2244
|
+
"sixty_five?" => {
|
|
2245
|
+
name: "sixty_five?",
|
|
2246
|
+
description: "returns whether the list size is sixty five.",
|
|
2247
|
+
examples: [
|
|
2248
|
+
"(1..65).to_list.sixty_five?",
|
|
2249
|
+
"(1..66).to_list.sixty_five?",
|
|
2250
|
+
"[].sixty_five?"
|
|
2251
|
+
]
|
|
2252
|
+
},
|
|
2253
|
+
"sixty_six?" => {
|
|
2254
|
+
name: "sixty_six?",
|
|
2255
|
+
description: "returns whether the list size is sixty six.",
|
|
2256
|
+
examples: [
|
|
2257
|
+
"(1..66).to_list.sixty_six?",
|
|
2258
|
+
"(1..67).to_list.sixty_six?",
|
|
2259
|
+
"[].sixty_six?"
|
|
2260
|
+
]
|
|
2261
|
+
},
|
|
2262
|
+
"sixty_seven?" => {
|
|
2263
|
+
name: "sixty_seven?",
|
|
2264
|
+
description: "returns whether the list size is sixty seven.",
|
|
2265
|
+
examples: [
|
|
2266
|
+
"(1..67).to_list.sixty_seven?",
|
|
2267
|
+
"(1..68).to_list.sixty_seven?",
|
|
2268
|
+
"[].sixty_seven?"
|
|
2269
|
+
]
|
|
2270
|
+
},
|
|
2271
|
+
"sixty_eight?" => {
|
|
2272
|
+
name: "sixty_eight?",
|
|
2273
|
+
description: "returns whether the list size is sixty eight.",
|
|
2274
|
+
examples: [
|
|
2275
|
+
"(1..68).to_list.sixty_eight?",
|
|
2276
|
+
"(1..69).to_list.sixty_eight?",
|
|
2277
|
+
"[].sixty_eight?"
|
|
2278
|
+
]
|
|
2279
|
+
},
|
|
2280
|
+
"sixty_nine?" => {
|
|
2281
|
+
name: "sixty_nine?",
|
|
2282
|
+
description: "returns whether the list size is sixty nine.",
|
|
2283
|
+
examples: [
|
|
2284
|
+
"(1..69).to_list.sixty_nine?",
|
|
2285
|
+
"(1..70).to_list.sixty_nine?",
|
|
2286
|
+
"[].sixty_nine?"
|
|
2287
|
+
]
|
|
2288
|
+
},
|
|
2289
|
+
"seventy?" => {
|
|
2290
|
+
name: "seventy?",
|
|
2291
|
+
description: "returns whether the list size is seventy.",
|
|
2292
|
+
examples: [
|
|
2293
|
+
"(1..70).to_list.seventy?",
|
|
2294
|
+
"(1..71).to_list.seventy?",
|
|
2295
|
+
"[].seventy?"
|
|
2296
|
+
]
|
|
2297
|
+
},
|
|
2298
|
+
"seventy_one?" => {
|
|
2299
|
+
name: "seventy_one?",
|
|
2300
|
+
description: "returns whether the list size is seventy one.",
|
|
2301
|
+
examples: [
|
|
2302
|
+
"(1..71).to_list.seventy_one?",
|
|
2303
|
+
"(1..72).to_list.seventy_one?",
|
|
2304
|
+
"[].seventy_one?"
|
|
2305
|
+
]
|
|
2306
|
+
},
|
|
2307
|
+
"seventy_two?" => {
|
|
2308
|
+
name: "seventy_two?",
|
|
2309
|
+
description: "returns whether the list size is seventy two.",
|
|
2310
|
+
examples: [
|
|
2311
|
+
"(1..72).to_list.seventy_two?",
|
|
2312
|
+
"(1..73).to_list.seventy_two?",
|
|
2313
|
+
"[].seventy_two?"
|
|
2314
|
+
]
|
|
2315
|
+
},
|
|
2316
|
+
"seventy_three?" => {
|
|
2317
|
+
name: "seventy_three?",
|
|
2318
|
+
description: "returns whether the list size is seventy three.",
|
|
2319
|
+
examples: [
|
|
2320
|
+
"(1..73).to_list.seventy_three?",
|
|
2321
|
+
"(1..74).to_list.seventy_three?",
|
|
2322
|
+
"[].seventy_three?"
|
|
2323
|
+
]
|
|
2324
|
+
},
|
|
2325
|
+
"seventy_four?" => {
|
|
2326
|
+
name: "seventy_four?",
|
|
2327
|
+
description: "returns whether the list size is seventy four.",
|
|
2328
|
+
examples: [
|
|
2329
|
+
"(1..74).to_list.seventy_four?",
|
|
2330
|
+
"(1..75).to_list.seventy_four?",
|
|
2331
|
+
"[].seventy_four?"
|
|
2332
|
+
]
|
|
2333
|
+
},
|
|
2334
|
+
"seventy_five?" => {
|
|
2335
|
+
name: "seventy_five?",
|
|
2336
|
+
description: "returns whether the list size is seventy five.",
|
|
2337
|
+
examples: [
|
|
2338
|
+
"(1..75).to_list.seventy_five?",
|
|
2339
|
+
"(1..76).to_list.seventy_five?",
|
|
2340
|
+
"[].seventy_five?"
|
|
2341
|
+
]
|
|
2342
|
+
},
|
|
2343
|
+
"seventy_six?" => {
|
|
2344
|
+
name: "seventy_six?",
|
|
2345
|
+
description: "returns whether the list size is seventy six.",
|
|
2346
|
+
examples: [
|
|
2347
|
+
"(1..76).to_list.seventy_six?",
|
|
2348
|
+
"(1..77).to_list.seventy_six?",
|
|
2349
|
+
"[].seventy_six?"
|
|
2350
|
+
]
|
|
2351
|
+
},
|
|
2352
|
+
"seventy_seven?" => {
|
|
2353
|
+
name: "seventy_seven?",
|
|
2354
|
+
description: "returns whether the list size is seventy seven.",
|
|
2355
|
+
examples: [
|
|
2356
|
+
"(1..77).to_list.seventy_seven?",
|
|
2357
|
+
"(1..78).to_list.seventy_seven?",
|
|
2358
|
+
"[].seventy_seven?"
|
|
2359
|
+
]
|
|
2360
|
+
},
|
|
2361
|
+
"seventy_eight?" => {
|
|
2362
|
+
name: "seventy_eight?",
|
|
2363
|
+
description: "returns whether the list size is seventy eight.",
|
|
2364
|
+
examples: [
|
|
2365
|
+
"(1..78).to_list.seventy_eight?",
|
|
2366
|
+
"(1..79).to_list.seventy_eight?",
|
|
2367
|
+
"[].seventy_eight?"
|
|
2368
|
+
]
|
|
2369
|
+
},
|
|
2370
|
+
"seventy_nine?" => {
|
|
2371
|
+
name: "seventy_nine?",
|
|
2372
|
+
description: "returns whether the list size is seventy nine.",
|
|
2373
|
+
examples: [
|
|
2374
|
+
"(1..79).to_list.seventy_nine?",
|
|
2375
|
+
"(1..80).to_list.seventy_nine?",
|
|
2376
|
+
"[].seventy_nine?"
|
|
2377
|
+
]
|
|
2378
|
+
},
|
|
2379
|
+
"eighty?" => {
|
|
2380
|
+
name: "eighty?",
|
|
2381
|
+
description: "returns whether the list size is eighty.",
|
|
2382
|
+
examples: [
|
|
2383
|
+
"(1..80).to_list.eighty?",
|
|
2384
|
+
"(1..81).to_list.eighty?",
|
|
2385
|
+
"[].eighty?"
|
|
2386
|
+
]
|
|
2387
|
+
},
|
|
2388
|
+
"eighty_one?" => {
|
|
2389
|
+
name: "eighty_one?",
|
|
2390
|
+
description: "returns whether the list size is eighty one.",
|
|
2391
|
+
examples: [
|
|
2392
|
+
"(1..81).to_list.eighty_one?",
|
|
2393
|
+
"(1..82).to_list.eighty_one?",
|
|
2394
|
+
"[].eighty_one?"
|
|
2395
|
+
]
|
|
2396
|
+
},
|
|
2397
|
+
"eighty_two?" => {
|
|
2398
|
+
name: "eighty_two?",
|
|
2399
|
+
description: "returns whether the list size is eighty two.",
|
|
2400
|
+
examples: [
|
|
2401
|
+
"(1..82).to_list.eighty_two?",
|
|
2402
|
+
"(1..83).to_list.eighty_two?",
|
|
2403
|
+
"[].eighty_two?"
|
|
2404
|
+
]
|
|
2405
|
+
},
|
|
2406
|
+
"eighty_three?" => {
|
|
2407
|
+
name: "eighty_three?",
|
|
2408
|
+
description: "returns whether the list size is eighty three.",
|
|
2409
|
+
examples: [
|
|
2410
|
+
"(1..83).to_list.eighty_three?",
|
|
2411
|
+
"(1..84).to_list.eighty_three?",
|
|
2412
|
+
"[].eighty_three?"
|
|
2413
|
+
]
|
|
2414
|
+
},
|
|
2415
|
+
"eighty_four?" => {
|
|
2416
|
+
name: "eighty_four?",
|
|
2417
|
+
description: "returns whether the list size is eighty four.",
|
|
2418
|
+
examples: [
|
|
2419
|
+
"(1..84).to_list.eighty_four?",
|
|
2420
|
+
"(1..85).to_list.eighty_four?",
|
|
2421
|
+
"[].eighty_four?"
|
|
2422
|
+
]
|
|
2423
|
+
},
|
|
2424
|
+
"eighty_five?" => {
|
|
2425
|
+
name: "eighty_five?",
|
|
2426
|
+
description: "returns whether the list size is eighty five.",
|
|
2427
|
+
examples: [
|
|
2428
|
+
"(1..85).to_list.eighty_five?",
|
|
2429
|
+
"(1..86).to_list.eighty_five?",
|
|
2430
|
+
"[].eighty_five?"
|
|
2431
|
+
]
|
|
2432
|
+
},
|
|
2433
|
+
"eighty_six?" => {
|
|
2434
|
+
name: "eighty_six?",
|
|
2435
|
+
description: "returns whether the list size is eighty six.",
|
|
2436
|
+
examples: [
|
|
2437
|
+
"(1..86).to_list.eighty_six?",
|
|
2438
|
+
"(1..87).to_list.eighty_six?",
|
|
2439
|
+
"[].eighty_six?"
|
|
2440
|
+
]
|
|
2441
|
+
},
|
|
2442
|
+
"eighty_seven?" => {
|
|
2443
|
+
name: "eighty_seven?",
|
|
2444
|
+
description: "returns whether the list size is eighty seven.",
|
|
2445
|
+
examples: [
|
|
2446
|
+
"(1..87).to_list.eighty_seven?",
|
|
2447
|
+
"(1..88).to_list.eighty_seven?",
|
|
2448
|
+
"[].eighty_seven?"
|
|
2449
|
+
]
|
|
2450
|
+
},
|
|
2451
|
+
"eighty_eight?" => {
|
|
2452
|
+
name: "eighty_eight?",
|
|
2453
|
+
description: "returns whether the list size is eighty eight.",
|
|
2454
|
+
examples: [
|
|
2455
|
+
"(1..88).to_list.eighty_eight?",
|
|
2456
|
+
"(1..89).to_list.eighty_eight?",
|
|
2457
|
+
"[].eighty_eight?"
|
|
2458
|
+
]
|
|
2459
|
+
},
|
|
2460
|
+
"eighty_nine?" => {
|
|
2461
|
+
name: "eighty_nine?",
|
|
2462
|
+
description: "returns whether the list size is eighty nine.",
|
|
2463
|
+
examples: [
|
|
2464
|
+
"(1..89).to_list.eighty_nine?",
|
|
2465
|
+
"(1..90).to_list.eighty_nine?",
|
|
2466
|
+
"[].eighty_nine?"
|
|
2467
|
+
]
|
|
2468
|
+
},
|
|
2469
|
+
"ninety?" => {
|
|
2470
|
+
name: "ninety?",
|
|
2471
|
+
description: "returns whether the list size is ninety.",
|
|
2472
|
+
examples: [
|
|
2473
|
+
"(1..90).to_list.ninety?",
|
|
2474
|
+
"(1..91).to_list.ninety?",
|
|
2475
|
+
"[].ninety?"
|
|
2476
|
+
]
|
|
2477
|
+
},
|
|
2478
|
+
"ninety_one?" => {
|
|
2479
|
+
name: "ninety_one?",
|
|
2480
|
+
description: "returns whether the list size is ninety one.",
|
|
2481
|
+
examples: [
|
|
2482
|
+
"(1..91).to_list.ninety_one?",
|
|
2483
|
+
"(1..92).to_list.ninety_one?",
|
|
2484
|
+
"[].ninety_one?"
|
|
2485
|
+
]
|
|
2486
|
+
},
|
|
2487
|
+
"ninety_two?" => {
|
|
2488
|
+
name: "ninety_two?",
|
|
2489
|
+
description: "returns whether the list size is ninety two.",
|
|
2490
|
+
examples: [
|
|
2491
|
+
"(1..92).to_list.ninety_two?",
|
|
2492
|
+
"(1..93).to_list.ninety_two?",
|
|
2493
|
+
"[].ninety_two?"
|
|
2494
|
+
]
|
|
2495
|
+
},
|
|
2496
|
+
"ninety_three?" => {
|
|
2497
|
+
name: "ninety_three?",
|
|
2498
|
+
description: "returns whether the list size is ninety three.",
|
|
2499
|
+
examples: [
|
|
2500
|
+
"(1..93).to_list.ninety_three?",
|
|
2501
|
+
"(1..94).to_list.ninety_three?",
|
|
2502
|
+
"[].ninety_three?"
|
|
2503
|
+
]
|
|
2504
|
+
},
|
|
2505
|
+
"ninety_four?" => {
|
|
2506
|
+
name: "ninety_four?",
|
|
2507
|
+
description: "returns whether the list size is ninety four.",
|
|
2508
|
+
examples: [
|
|
2509
|
+
"(1..94).to_list.ninety_four?",
|
|
2510
|
+
"(1..95).to_list.ninety_four?",
|
|
2511
|
+
"[].ninety_four?"
|
|
2512
|
+
]
|
|
2513
|
+
},
|
|
2514
|
+
"ninety_five?" => {
|
|
2515
|
+
name: "ninety_five?",
|
|
2516
|
+
description: "returns whether the list size is ninety five.",
|
|
2517
|
+
examples: [
|
|
2518
|
+
"(1..95).to_list.ninety_five?",
|
|
2519
|
+
"(1..96).to_list.ninety_five?",
|
|
2520
|
+
"[].ninety_five?"
|
|
2521
|
+
]
|
|
2522
|
+
},
|
|
2523
|
+
"ninety_six?" => {
|
|
2524
|
+
name: "ninety_six?",
|
|
2525
|
+
description: "returns whether the list size is ninety six.",
|
|
2526
|
+
examples: [
|
|
2527
|
+
"(1..96).to_list.ninety_six?",
|
|
2528
|
+
"(1..97).to_list.ninety_six?",
|
|
2529
|
+
"[].ninety_six?"
|
|
2530
|
+
]
|
|
2531
|
+
},
|
|
2532
|
+
"ninety_seven?" => {
|
|
2533
|
+
name: "ninety_seven?",
|
|
2534
|
+
description: "returns whether the list size is ninety seven.",
|
|
2535
|
+
examples: [
|
|
2536
|
+
"(1..97).to_list.ninety_seven?",
|
|
2537
|
+
"(1..98).to_list.ninety_seven?",
|
|
2538
|
+
"[].ninety_seven?"
|
|
2539
|
+
]
|
|
2540
|
+
},
|
|
2541
|
+
"ninety_eight?" => {
|
|
2542
|
+
name: "ninety_eight?",
|
|
2543
|
+
description: "returns whether the list size is ninety eight.",
|
|
2544
|
+
examples: [
|
|
2545
|
+
"(1..98).to_list.ninety_eight?",
|
|
2546
|
+
"(1..99).to_list.ninety_eight?",
|
|
2547
|
+
"[].ninety_eight?"
|
|
2548
|
+
]
|
|
2549
|
+
},
|
|
2550
|
+
"ninety_nine?" => {
|
|
2551
|
+
name: "ninety_nine?",
|
|
2552
|
+
description: "returns whether the list size is ninety nine.",
|
|
2553
|
+
examples: [
|
|
2554
|
+
"(1..99).to_list.ninety_nine?",
|
|
2555
|
+
"(1..100).to_list.ninety_nine?",
|
|
2556
|
+
"[].ninety_nine?"
|
|
2557
|
+
]
|
|
2558
|
+
},
|
|
2559
|
+
"one_hundred?" => {
|
|
2560
|
+
name: "one_hundred?",
|
|
2561
|
+
description: "returns whether the list size is one hundred.",
|
|
2562
|
+
examples: [
|
|
2563
|
+
"(1..100).to_list.one_hundred?",
|
|
2564
|
+
"(1..101).to_list.one_hundred?",
|
|
2565
|
+
"[].one_hundred?"
|
|
2566
|
+
]
|
|
2567
|
+
}
|
|
2568
|
+
}.freeze
|
|
2569
|
+
def self.function_documentation(scope)
|
|
2570
|
+
return INSTANCE_FUNCTIONS if scope == :instance
|
|
2571
|
+
|
|
2572
|
+
{}
|
|
2573
|
+
end
|
|
2574
|
+
|
|
6
2575
|
delegate(
|
|
7
2576
|
:code_many?,
|
|
8
2577
|
:code_positive?,
|
|
@@ -133,15 +2702,51 @@ class Code
|
|
|
133
2702
|
code_value = code_arguments.code_first
|
|
134
2703
|
|
|
135
2704
|
case code_operator.to_s
|
|
2705
|
+
when "[]", "at", "get"
|
|
2706
|
+
sig(args) { Integer }
|
|
2707
|
+
code_get(code_value)
|
|
2708
|
+
when "fetch"
|
|
2709
|
+
sig(args) { Integer }
|
|
2710
|
+
code_fetch(code_value)
|
|
2711
|
+
when "values_at"
|
|
2712
|
+
sig(args) { Integer.repeat(1) }
|
|
2713
|
+
code_values_at(*code_arguments.raw)
|
|
2714
|
+
when "slice"
|
|
2715
|
+
sig(args) { [Object, Integer.maybe] }
|
|
2716
|
+
code_slice(*code_arguments.raw)
|
|
2717
|
+
when "slice!"
|
|
2718
|
+
sig(args) { [Object, Integer.maybe] }
|
|
2719
|
+
code_slice!(*code_arguments.raw)
|
|
2720
|
+
when "clear"
|
|
2721
|
+
sig(args)
|
|
2722
|
+
code_clear
|
|
136
2723
|
when "join"
|
|
137
2724
|
sig(args) { String.maybe }
|
|
138
2725
|
code_join(code_value)
|
|
139
2726
|
when "sort"
|
|
140
2727
|
sig(args) { Function.maybe }
|
|
141
2728
|
code_sort(code_value, **globals)
|
|
2729
|
+
when "sort!"
|
|
2730
|
+
sig(args) { Function.maybe }
|
|
2731
|
+
code_sort!(code_value, **globals)
|
|
142
2732
|
when "<<", "append"
|
|
143
2733
|
sig(args) { Object }
|
|
144
2734
|
code_append(code_value)
|
|
2735
|
+
when "push"
|
|
2736
|
+
sig(args) { Object }
|
|
2737
|
+
code_push(code_value)
|
|
2738
|
+
when "prepend"
|
|
2739
|
+
sig(args) { Object }
|
|
2740
|
+
code_prepend(code_value)
|
|
2741
|
+
when "insert"
|
|
2742
|
+
sig(args) { [Integer, Object] }
|
|
2743
|
+
code_insert(*code_arguments.raw)
|
|
2744
|
+
when "concat"
|
|
2745
|
+
sig(args) { List.repeat(1) }
|
|
2746
|
+
code_concat(*code_arguments.raw)
|
|
2747
|
+
when "fill"
|
|
2748
|
+
sig(args) { [Object, Integer.maybe, Integer.maybe] }
|
|
2749
|
+
code_fill(*code_arguments.raw)
|
|
145
2750
|
when "+", "plus"
|
|
146
2751
|
sig(args) { List.maybe }
|
|
147
2752
|
code_arguments.any? ? code_plus(code_value) : code_self
|
|
@@ -154,9 +2759,18 @@ class Code
|
|
|
154
2759
|
when "detect"
|
|
155
2760
|
sig(args) { (Function | Class).maybe }
|
|
156
2761
|
code_detect(code_value, **globals)
|
|
2762
|
+
when "index", "find_index"
|
|
2763
|
+
sig(args) { (Object | Function | Class).maybe }
|
|
2764
|
+
code_index(code_value, **globals)
|
|
2765
|
+
when "right_index"
|
|
2766
|
+
sig(args) { (Object | Function | Class).maybe }
|
|
2767
|
+
code_right_index(code_value, **globals)
|
|
157
2768
|
when "each"
|
|
158
2769
|
sig(args) { (Function | Class).maybe }
|
|
159
2770
|
code_each(code_value, **globals)
|
|
2771
|
+
when "each_index"
|
|
2772
|
+
sig(args) { Function }
|
|
2773
|
+
code_each_index(code_value, **globals)
|
|
160
2774
|
when "first"
|
|
161
2775
|
sig(args) { Integer.maybe }
|
|
162
2776
|
code_first(code_value)
|
|
@@ -463,9 +3077,24 @@ class Code
|
|
|
463
3077
|
when "shuffle"
|
|
464
3078
|
sig(args)
|
|
465
3079
|
code_shuffle
|
|
3080
|
+
when "shuffle!"
|
|
3081
|
+
sig(args)
|
|
3082
|
+
code_shuffle!
|
|
466
3083
|
when "flatten"
|
|
467
3084
|
sig(args) { Integer.maybe }
|
|
468
3085
|
code_flatten(code_value)
|
|
3086
|
+
when "delete"
|
|
3087
|
+
sig(args) { Object }
|
|
3088
|
+
code_delete(code_value)
|
|
3089
|
+
when "delete_at"
|
|
3090
|
+
sig(args) { Integer }
|
|
3091
|
+
code_delete_at(code_value)
|
|
3092
|
+
when "delete_if"
|
|
3093
|
+
sig(args) { Function | Class }
|
|
3094
|
+
code_delete_if(code_value, **globals)
|
|
3095
|
+
when "keep_if"
|
|
3096
|
+
sig(args) { Function | Class }
|
|
3097
|
+
code_keep_if(code_value, **globals)
|
|
469
3098
|
when "pop"
|
|
470
3099
|
sig(args) { Integer.maybe }
|
|
471
3100
|
code_pop(code_value)
|
|
@@ -475,21 +3104,48 @@ class Code
|
|
|
475
3104
|
when "shift"
|
|
476
3105
|
sig(args) { Integer.maybe }
|
|
477
3106
|
code_shift(code_value)
|
|
478
|
-
when "include?"
|
|
3107
|
+
when "include?", "member?"
|
|
479
3108
|
sig(args) { Object }
|
|
480
3109
|
code_include?(code_value)
|
|
481
3110
|
when "last"
|
|
482
3111
|
sig(args)
|
|
483
3112
|
code_last
|
|
3113
|
+
when "take"
|
|
3114
|
+
sig(args) { Integer }
|
|
3115
|
+
code_take(code_value)
|
|
3116
|
+
when "drop"
|
|
3117
|
+
sig(args) { Integer }
|
|
3118
|
+
code_drop(code_value)
|
|
3119
|
+
when "drop_while"
|
|
3120
|
+
sig(args) { Function | Class }
|
|
3121
|
+
code_drop_while(code_value, **globals)
|
|
3122
|
+
when "take_while"
|
|
3123
|
+
sig(args) { Function | Class }
|
|
3124
|
+
code_take_while(code_value, **globals)
|
|
3125
|
+
when "zip"
|
|
3126
|
+
sig(args) { List.repeat(1) }
|
|
3127
|
+
code_zip(*code_arguments.raw)
|
|
484
3128
|
when "map"
|
|
485
3129
|
sig(args) { (Function | Class).maybe }
|
|
486
3130
|
code_map(code_value, **globals)
|
|
487
3131
|
when "map!"
|
|
488
3132
|
sig(args) { (Function | Class).maybe }
|
|
489
3133
|
code_map!(code_value, **globals)
|
|
3134
|
+
when "flat_map"
|
|
3135
|
+
sig(args) { Function | Class }
|
|
3136
|
+
code_flat_map(code_value, **globals)
|
|
490
3137
|
when "max"
|
|
491
3138
|
sig(args) { (Function | Class).maybe }
|
|
492
3139
|
code_max(code_value, **globals)
|
|
3140
|
+
when "maximum"
|
|
3141
|
+
sig(args) { (Function | Class).maybe }
|
|
3142
|
+
code_maximum(code_value, **globals)
|
|
3143
|
+
when "minimum"
|
|
3144
|
+
sig(args) { (Function | Class).maybe }
|
|
3145
|
+
code_minimum(code_value, **globals)
|
|
3146
|
+
when "minimum_maximum"
|
|
3147
|
+
sig(args) { (Function | Class).maybe }
|
|
3148
|
+
code_minimum_maximum(code_value, **globals)
|
|
493
3149
|
when "none?"
|
|
494
3150
|
sig(args) { (Function | Class).maybe }
|
|
495
3151
|
code_none?(code_value, **globals)
|
|
@@ -499,13 +3155,70 @@ class Code
|
|
|
499
3155
|
when "reduce"
|
|
500
3156
|
sig(args) { (Function | Class).maybe }
|
|
501
3157
|
code_reduce(code_value, **globals)
|
|
3158
|
+
when "group"
|
|
3159
|
+
sig(args) { (Function | Class).maybe }
|
|
3160
|
+
code_group(code_value, **globals)
|
|
3161
|
+
when "partition"
|
|
3162
|
+
sig(args) { Function | Class }
|
|
3163
|
+
code_partition(code_value, **globals)
|
|
3164
|
+
when "cycle"
|
|
3165
|
+
sig(args) { [Integer.maybe, Function.maybe] }
|
|
3166
|
+
code_cycle(*code_arguments.raw, **globals)
|
|
3167
|
+
when "transpose"
|
|
3168
|
+
sig(args)
|
|
3169
|
+
code_transpose
|
|
3170
|
+
when "combination"
|
|
3171
|
+
sig(args) { Integer }
|
|
3172
|
+
code_combination(code_value)
|
|
3173
|
+
when "permutation"
|
|
3174
|
+
sig(args) { Integer.maybe }
|
|
3175
|
+
code_permutation(code_value)
|
|
3176
|
+
when "product"
|
|
3177
|
+
sig(args) { List.repeat(1) }
|
|
3178
|
+
code_product(*code_arguments.raw)
|
|
3179
|
+
when "repeated_combination"
|
|
3180
|
+
sig(args) { Integer }
|
|
3181
|
+
code_repeated_combination(code_value)
|
|
3182
|
+
when "repeated_permutation"
|
|
3183
|
+
sig(args) { Integer }
|
|
3184
|
+
code_repeated_permutation(code_value)
|
|
502
3185
|
when "reverse"
|
|
503
3186
|
sig(args)
|
|
504
3187
|
code_reverse
|
|
505
|
-
when "
|
|
3188
|
+
when "reverse!"
|
|
3189
|
+
sig(args)
|
|
3190
|
+
code_reverse!
|
|
3191
|
+
when "reverse_each"
|
|
3192
|
+
sig(args) { Function }
|
|
3193
|
+
code_reverse_each(code_value, **globals)
|
|
3194
|
+
when "rotate"
|
|
3195
|
+
sig(args) { Integer.maybe }
|
|
3196
|
+
code_rotate(code_value)
|
|
3197
|
+
when "rotate!"
|
|
3198
|
+
sig(args) { Integer.maybe }
|
|
3199
|
+
code_rotate!(code_value)
|
|
3200
|
+
when "union"
|
|
3201
|
+
sig(args) { List.repeat(1) }
|
|
3202
|
+
code_union(*code_arguments.raw)
|
|
3203
|
+
when "intersection"
|
|
3204
|
+
sig(args) { List.repeat(1) }
|
|
3205
|
+
code_intersection(*code_arguments.raw)
|
|
3206
|
+
when "difference"
|
|
3207
|
+
sig(args) { List.repeat(1) }
|
|
3208
|
+
code_difference(*code_arguments.raw)
|
|
3209
|
+
when "intersect?"
|
|
3210
|
+
sig(args) { List }
|
|
3211
|
+
code_intersect?(code_value)
|
|
3212
|
+
when "associate"
|
|
3213
|
+
sig(args) { Object }
|
|
3214
|
+
code_associate(code_value)
|
|
3215
|
+
when "right_associate"
|
|
3216
|
+
sig(args) { Object }
|
|
3217
|
+
code_right_associate(code_value)
|
|
3218
|
+
when "select", "filter"
|
|
506
3219
|
sig(args) { (Function | Class).maybe }
|
|
507
3220
|
code_select(code_value, **globals)
|
|
508
|
-
when "select!"
|
|
3221
|
+
when "select!", "filter!"
|
|
509
3222
|
sig(args) { (Function | Class).maybe }
|
|
510
3223
|
code_select!(code_value, **globals)
|
|
511
3224
|
when "compact"
|
|
@@ -520,15 +3233,36 @@ class Code
|
|
|
520
3233
|
when "reject!"
|
|
521
3234
|
sig(args) { (Function | Class).maybe }
|
|
522
3235
|
code_reject!(code_value, **globals)
|
|
523
|
-
when "size"
|
|
3236
|
+
when "size", "length"
|
|
524
3237
|
sig(args)
|
|
525
3238
|
code_size
|
|
3239
|
+
when "empty?"
|
|
3240
|
+
sig(args)
|
|
3241
|
+
code_empty?
|
|
3242
|
+
when "count"
|
|
3243
|
+
sig(args) { (Function | Class).maybe }
|
|
3244
|
+
code_count(code_value, **globals)
|
|
526
3245
|
when "sum"
|
|
527
3246
|
sig(args)
|
|
528
3247
|
code_sum
|
|
3248
|
+
when "tally"
|
|
3249
|
+
sig(args)
|
|
3250
|
+
code_tally
|
|
3251
|
+
when "entries"
|
|
3252
|
+
sig(args)
|
|
3253
|
+
code_entries
|
|
3254
|
+
when "to_dictionary"
|
|
3255
|
+
sig(args)
|
|
3256
|
+
code_to_dictionary
|
|
529
3257
|
when "uniq"
|
|
530
3258
|
sig(args) { (Function | Class).maybe }
|
|
531
3259
|
code_uniq(code_value, **globals)
|
|
3260
|
+
when "sort_by!"
|
|
3261
|
+
sig(args) { (Function | Class).maybe }
|
|
3262
|
+
code_sort_by!(code_value, **globals)
|
|
3263
|
+
when "uniq!"
|
|
3264
|
+
sig(args) { (Function | Class).maybe }
|
|
3265
|
+
code_uniq!(code_value, **globals)
|
|
532
3266
|
when "many?"
|
|
533
3267
|
sig(args)
|
|
534
3268
|
code_many?
|
|
@@ -882,6 +3616,49 @@ class Code
|
|
|
882
3616
|
self
|
|
883
3617
|
end
|
|
884
3618
|
|
|
3619
|
+
def code_clear
|
|
3620
|
+
raw.clear
|
|
3621
|
+
self
|
|
3622
|
+
end
|
|
3623
|
+
|
|
3624
|
+
def code_push(other)
|
|
3625
|
+
code_append(other)
|
|
3626
|
+
end
|
|
3627
|
+
|
|
3628
|
+
def code_prepend(other)
|
|
3629
|
+
code_other = other.to_code
|
|
3630
|
+
raw.unshift(code_other)
|
|
3631
|
+
self
|
|
3632
|
+
end
|
|
3633
|
+
|
|
3634
|
+
def code_insert(index, value)
|
|
3635
|
+
code_index = index.to_code
|
|
3636
|
+
code_value = value.to_code
|
|
3637
|
+
raw.insert(code_index.raw, code_value)
|
|
3638
|
+
self
|
|
3639
|
+
end
|
|
3640
|
+
|
|
3641
|
+
def code_concat(*lists)
|
|
3642
|
+
lists.to_code.raw.each { |list| raw.concat(list.raw) }
|
|
3643
|
+
self
|
|
3644
|
+
end
|
|
3645
|
+
|
|
3646
|
+
def code_fill(value, start = nil, length = nil)
|
|
3647
|
+
code_value = value.to_code
|
|
3648
|
+
code_start = start.to_code
|
|
3649
|
+
code_length = length.to_code
|
|
3650
|
+
|
|
3651
|
+
if code_start.nothing?
|
|
3652
|
+
raw.fill(code_value)
|
|
3653
|
+
elsif code_length.nothing?
|
|
3654
|
+
raw.fill(code_value, code_start.raw)
|
|
3655
|
+
else
|
|
3656
|
+
raw.fill(code_value, code_start.raw, code_length.raw)
|
|
3657
|
+
end
|
|
3658
|
+
|
|
3659
|
+
self
|
|
3660
|
+
end
|
|
3661
|
+
|
|
885
3662
|
def code_plus(other)
|
|
886
3663
|
code_other = other.to_code
|
|
887
3664
|
|
|
@@ -915,6 +3692,60 @@ class Code
|
|
|
915
3692
|
e.code_value
|
|
916
3693
|
end
|
|
917
3694
|
|
|
3695
|
+
def code_index(argument = nil, **globals)
|
|
3696
|
+
code_argument = argument.to_code
|
|
3697
|
+
|
|
3698
|
+
if code_argument.nothing?
|
|
3699
|
+
return Nothing.new
|
|
3700
|
+
elsif code_argument.is_a?(Function)
|
|
3701
|
+
index =
|
|
3702
|
+
raw.index.with_index do |code_element, index|
|
|
3703
|
+
code_argument.call(
|
|
3704
|
+
arguments: List.new([code_element, Integer.new(index), self]),
|
|
3705
|
+
**globals
|
|
3706
|
+
).truthy?
|
|
3707
|
+
rescue Error::Next => e
|
|
3708
|
+
e.code_value.truthy?
|
|
3709
|
+
end
|
|
3710
|
+
elsif code_argument.is_a?(Class)
|
|
3711
|
+
index =
|
|
3712
|
+
raw.index { |code_element| code_element.is_a?(code_argument.raw) }
|
|
3713
|
+
else
|
|
3714
|
+
index = raw.index(code_argument)
|
|
3715
|
+
end
|
|
3716
|
+
|
|
3717
|
+
index.nil? ? Nothing.new : Integer.new(index)
|
|
3718
|
+
rescue Error::Break => e
|
|
3719
|
+
e.code_value
|
|
3720
|
+
end
|
|
3721
|
+
|
|
3722
|
+
def code_right_index(argument = nil, **globals)
|
|
3723
|
+
code_argument = argument.to_code
|
|
3724
|
+
|
|
3725
|
+
if code_argument.nothing?
|
|
3726
|
+
return Nothing.new
|
|
3727
|
+
elsif code_argument.is_a?(Function)
|
|
3728
|
+
index =
|
|
3729
|
+
raw.rindex.with_index do |code_element, index|
|
|
3730
|
+
code_argument.call(
|
|
3731
|
+
arguments: List.new([code_element, Integer.new(index), self]),
|
|
3732
|
+
**globals
|
|
3733
|
+
).truthy?
|
|
3734
|
+
rescue Error::Next => e
|
|
3735
|
+
e.code_value.truthy?
|
|
3736
|
+
end
|
|
3737
|
+
elsif code_argument.is_a?(Class)
|
|
3738
|
+
index =
|
|
3739
|
+
raw.rindex { |code_element| code_element.is_a?(code_argument.raw) }
|
|
3740
|
+
else
|
|
3741
|
+
index = raw.rindex(code_argument)
|
|
3742
|
+
end
|
|
3743
|
+
|
|
3744
|
+
index.nil? ? Nothing.new : Integer.new(index)
|
|
3745
|
+
rescue Error::Break => e
|
|
3746
|
+
e.code_value
|
|
3747
|
+
end
|
|
3748
|
+
|
|
918
3749
|
def code_each(argument = nil, **globals)
|
|
919
3750
|
code_argument = argument.to_code
|
|
920
3751
|
|
|
@@ -936,6 +3767,24 @@ class Code
|
|
|
936
3767
|
e.code_value
|
|
937
3768
|
end
|
|
938
3769
|
|
|
3770
|
+
def code_each_index(argument, **globals)
|
|
3771
|
+
code_argument = argument.to_code
|
|
3772
|
+
|
|
3773
|
+
raw.each_index do |index|
|
|
3774
|
+
code_index = Integer.new(index)
|
|
3775
|
+
code_argument.call(
|
|
3776
|
+
arguments: List.new([code_index, code_index, self]),
|
|
3777
|
+
**globals
|
|
3778
|
+
)
|
|
3779
|
+
rescue Error::Next => e
|
|
3780
|
+
e.code_value
|
|
3781
|
+
end
|
|
3782
|
+
|
|
3783
|
+
self
|
|
3784
|
+
rescue Error::Break => e
|
|
3785
|
+
e.code_value
|
|
3786
|
+
end
|
|
3787
|
+
|
|
939
3788
|
def code_first(value = nil)
|
|
940
3789
|
code_value = value.to_code
|
|
941
3790
|
|
|
@@ -1360,6 +4209,11 @@ class Code
|
|
|
1360
4209
|
List.new(raw.shuffle)
|
|
1361
4210
|
end
|
|
1362
4211
|
|
|
4212
|
+
def code_shuffle!
|
|
4213
|
+
raw.shuffle!
|
|
4214
|
+
self
|
|
4215
|
+
end
|
|
4216
|
+
|
|
1363
4217
|
def code_flatten(level = nil)
|
|
1364
4218
|
code_level = level.to_code
|
|
1365
4219
|
code_level = Integer.new(-1) if code_level.nothing?
|
|
@@ -1380,6 +4234,58 @@ class Code
|
|
|
1380
4234
|
)
|
|
1381
4235
|
end
|
|
1382
4236
|
|
|
4237
|
+
def code_delete(value)
|
|
4238
|
+
code_value = value.to_code
|
|
4239
|
+
raw.delete(code_value) || Nothing.new
|
|
4240
|
+
end
|
|
4241
|
+
|
|
4242
|
+
def code_delete_at(index)
|
|
4243
|
+
code_index = index.to_code
|
|
4244
|
+
raw.delete_at(code_index.raw) || Nothing.new
|
|
4245
|
+
end
|
|
4246
|
+
|
|
4247
|
+
def code_delete_if(argument, **globals)
|
|
4248
|
+
code_argument = argument.to_code
|
|
4249
|
+
|
|
4250
|
+
raw.delete_if.with_index do |code_element, index|
|
|
4251
|
+
if code_argument.is_a?(Class)
|
|
4252
|
+
code_element.is_a?(code_argument.raw)
|
|
4253
|
+
else
|
|
4254
|
+
code_argument.call(
|
|
4255
|
+
arguments: List.new([code_element, Integer.new(index), self]),
|
|
4256
|
+
**globals
|
|
4257
|
+
).truthy?
|
|
4258
|
+
end
|
|
4259
|
+
rescue Error::Next => e
|
|
4260
|
+
e.code_value.truthy?
|
|
4261
|
+
end
|
|
4262
|
+
|
|
4263
|
+
self
|
|
4264
|
+
rescue Error::Break => e
|
|
4265
|
+
e.code_value
|
|
4266
|
+
end
|
|
4267
|
+
|
|
4268
|
+
def code_keep_if(argument, **globals)
|
|
4269
|
+
code_argument = argument.to_code
|
|
4270
|
+
|
|
4271
|
+
raw.keep_if.with_index do |code_element, index|
|
|
4272
|
+
if code_argument.is_a?(Class)
|
|
4273
|
+
code_element.is_a?(code_argument.raw)
|
|
4274
|
+
else
|
|
4275
|
+
code_argument.call(
|
|
4276
|
+
arguments: List.new([code_element, Integer.new(index), self]),
|
|
4277
|
+
**globals
|
|
4278
|
+
).truthy?
|
|
4279
|
+
end
|
|
4280
|
+
rescue Error::Next => e
|
|
4281
|
+
e.code_value.truthy?
|
|
4282
|
+
end
|
|
4283
|
+
|
|
4284
|
+
self
|
|
4285
|
+
rescue Error::Break => e
|
|
4286
|
+
e.code_value
|
|
4287
|
+
end
|
|
4288
|
+
|
|
1383
4289
|
def code_pop(n = nil)
|
|
1384
4290
|
code_n = n.to_code
|
|
1385
4291
|
n = code_n.raw
|
|
@@ -1411,6 +4317,63 @@ class Code
|
|
|
1411
4317
|
raw.last || Nothing.new
|
|
1412
4318
|
end
|
|
1413
4319
|
|
|
4320
|
+
def code_take(n)
|
|
4321
|
+
code_n = n.to_code
|
|
4322
|
+
List.new(raw.take(code_n.raw))
|
|
4323
|
+
end
|
|
4324
|
+
|
|
4325
|
+
def code_drop(n)
|
|
4326
|
+
code_n = n.to_code
|
|
4327
|
+
List.new(raw.drop(code_n.raw))
|
|
4328
|
+
end
|
|
4329
|
+
|
|
4330
|
+
def code_drop_while(argument, **globals)
|
|
4331
|
+
code_argument = argument.to_code
|
|
4332
|
+
|
|
4333
|
+
List.new(
|
|
4334
|
+
raw.drop_while.with_index do |code_element, index|
|
|
4335
|
+
if code_argument.is_a?(Class)
|
|
4336
|
+
code_element.is_a?(code_argument.raw)
|
|
4337
|
+
else
|
|
4338
|
+
code_argument.call(
|
|
4339
|
+
arguments: List.new([code_element, Integer.new(index), self]),
|
|
4340
|
+
**globals
|
|
4341
|
+
).truthy?
|
|
4342
|
+
end
|
|
4343
|
+
rescue Error::Next => e
|
|
4344
|
+
e.code_value.truthy?
|
|
4345
|
+
end
|
|
4346
|
+
)
|
|
4347
|
+
rescue Error::Break => e
|
|
4348
|
+
e.code_value
|
|
4349
|
+
end
|
|
4350
|
+
|
|
4351
|
+
def code_take_while(argument, **globals)
|
|
4352
|
+
code_argument = argument.to_code
|
|
4353
|
+
|
|
4354
|
+
List.new(
|
|
4355
|
+
raw.take_while.with_index do |code_element, index|
|
|
4356
|
+
if code_argument.is_a?(Class)
|
|
4357
|
+
code_element.is_a?(code_argument.raw)
|
|
4358
|
+
else
|
|
4359
|
+
code_argument.call(
|
|
4360
|
+
arguments: List.new([code_element, Integer.new(index), self]),
|
|
4361
|
+
**globals
|
|
4362
|
+
).truthy?
|
|
4363
|
+
end
|
|
4364
|
+
rescue Error::Next => e
|
|
4365
|
+
e.code_value.truthy?
|
|
4366
|
+
end
|
|
4367
|
+
)
|
|
4368
|
+
rescue Error::Break => e
|
|
4369
|
+
e.code_value
|
|
4370
|
+
end
|
|
4371
|
+
|
|
4372
|
+
def code_zip(*arguments)
|
|
4373
|
+
code_arguments = arguments.to_code
|
|
4374
|
+
List.new(raw.zip(*code_arguments.raw.map(&:raw)))
|
|
4375
|
+
end
|
|
4376
|
+
|
|
1414
4377
|
def code_map(argument = nil, **globals)
|
|
1415
4378
|
code_argument = argument.to_code
|
|
1416
4379
|
|
|
@@ -1457,6 +4420,32 @@ class Code
|
|
|
1457
4420
|
e.code_value
|
|
1458
4421
|
end
|
|
1459
4422
|
|
|
4423
|
+
def code_flat_map(argument = nil, **globals)
|
|
4424
|
+
code_argument = argument.to_code
|
|
4425
|
+
|
|
4426
|
+
List.new(
|
|
4427
|
+
raw.flat_map.with_index do |code_element, index|
|
|
4428
|
+
result =
|
|
4429
|
+
if code_argument.is_a?(Function)
|
|
4430
|
+
code_argument.call(
|
|
4431
|
+
arguments: List.new([code_element, Integer.new(index), self]),
|
|
4432
|
+
**globals
|
|
4433
|
+
)
|
|
4434
|
+
elsif code_argument.is_a?(Class)
|
|
4435
|
+
code_argument.raw.new(code_element)
|
|
4436
|
+
else
|
|
4437
|
+
Nothing.new
|
|
4438
|
+
end
|
|
4439
|
+
|
|
4440
|
+
result.is_a?(List) ? result.raw : result
|
|
4441
|
+
rescue Error::Next => e
|
|
4442
|
+
e.code_value.is_a?(List) ? e.code_value.raw : e.code_value
|
|
4443
|
+
end
|
|
4444
|
+
)
|
|
4445
|
+
rescue Error::Break => e
|
|
4446
|
+
e.code_value
|
|
4447
|
+
end
|
|
4448
|
+
|
|
1460
4449
|
def code_max(argument = nil, **globals)
|
|
1461
4450
|
code_argument = argument.to_code
|
|
1462
4451
|
|
|
@@ -1476,6 +4465,51 @@ class Code
|
|
|
1476
4465
|
e.code_value
|
|
1477
4466
|
end
|
|
1478
4467
|
|
|
4468
|
+
def code_maximum(argument = nil, **globals)
|
|
4469
|
+
code_max(argument, **globals)
|
|
4470
|
+
end
|
|
4471
|
+
|
|
4472
|
+
def code_minimum(argument = nil, **globals)
|
|
4473
|
+
code_argument = argument.to_code
|
|
4474
|
+
|
|
4475
|
+
raw.min_by.with_index do |code_element, index|
|
|
4476
|
+
if code_argument.is_a?(Function)
|
|
4477
|
+
code_argument.call(
|
|
4478
|
+
arguments: List.new([code_element, Integer.new(index), self]),
|
|
4479
|
+
**globals
|
|
4480
|
+
)
|
|
4481
|
+
else
|
|
4482
|
+
code_element
|
|
4483
|
+
end
|
|
4484
|
+
rescue Error::Next => e
|
|
4485
|
+
e.code_value
|
|
4486
|
+
end || Nothing.new
|
|
4487
|
+
rescue Error::Break => e
|
|
4488
|
+
e.code_value
|
|
4489
|
+
end
|
|
4490
|
+
|
|
4491
|
+
def code_minimum_maximum(argument = nil, **globals)
|
|
4492
|
+
code_argument = argument.to_code
|
|
4493
|
+
|
|
4494
|
+
values =
|
|
4495
|
+
raw.minmax_by.with_index do |code_element, index|
|
|
4496
|
+
if code_argument.is_a?(Function)
|
|
4497
|
+
code_argument.call(
|
|
4498
|
+
arguments: List.new([code_element, Integer.new(index), self]),
|
|
4499
|
+
**globals
|
|
4500
|
+
)
|
|
4501
|
+
else
|
|
4502
|
+
code_element
|
|
4503
|
+
end
|
|
4504
|
+
rescue Error::Next => e
|
|
4505
|
+
e.code_value
|
|
4506
|
+
end
|
|
4507
|
+
|
|
4508
|
+
List.new(values)
|
|
4509
|
+
rescue Error::Break => e
|
|
4510
|
+
e.code_value
|
|
4511
|
+
end
|
|
4512
|
+
|
|
1479
4513
|
def code_none?(argument = nil, **globals)
|
|
1480
4514
|
code_argument = argument.to_code
|
|
1481
4515
|
|
|
@@ -1556,10 +4590,209 @@ class Code
|
|
|
1556
4590
|
e.code_value
|
|
1557
4591
|
end
|
|
1558
4592
|
|
|
4593
|
+
def code_group(argument = nil, **globals)
|
|
4594
|
+
code_argument = argument.to_code
|
|
4595
|
+
|
|
4596
|
+
grouped =
|
|
4597
|
+
raw.group_by.with_index do |code_element, index|
|
|
4598
|
+
if code_argument.is_a?(Function)
|
|
4599
|
+
code_argument.call(
|
|
4600
|
+
arguments: List.new([code_element, Integer.new(index), self]),
|
|
4601
|
+
**globals
|
|
4602
|
+
)
|
|
4603
|
+
elsif code_argument.is_a?(Class)
|
|
4604
|
+
Boolean.new(code_element.is_a?(code_argument.raw))
|
|
4605
|
+
else
|
|
4606
|
+
code_element
|
|
4607
|
+
end
|
|
4608
|
+
rescue Error::Next => e
|
|
4609
|
+
e.code_value
|
|
4610
|
+
end
|
|
4611
|
+
|
|
4612
|
+
Dictionary.new(grouped.transform_values { |values| List.new(values) })
|
|
4613
|
+
rescue Error::Break => e
|
|
4614
|
+
e.code_value
|
|
4615
|
+
end
|
|
4616
|
+
|
|
4617
|
+
def code_partition(argument, **globals)
|
|
4618
|
+
code_argument = argument.to_code
|
|
4619
|
+
|
|
4620
|
+
lists =
|
|
4621
|
+
raw.partition.with_index do |code_element, index|
|
|
4622
|
+
if code_argument.is_a?(Function)
|
|
4623
|
+
code_argument.call(
|
|
4624
|
+
arguments: List.new([code_element, Integer.new(index), self]),
|
|
4625
|
+
**globals
|
|
4626
|
+
).truthy?
|
|
4627
|
+
elsif code_argument.is_a?(Class)
|
|
4628
|
+
code_element.is_a?(code_argument.raw)
|
|
4629
|
+
else
|
|
4630
|
+
false
|
|
4631
|
+
end
|
|
4632
|
+
rescue Error::Next => e
|
|
4633
|
+
e.code_value.truthy?
|
|
4634
|
+
end
|
|
4635
|
+
|
|
4636
|
+
List.new(lists.map { |list| List.new(list) })
|
|
4637
|
+
rescue Error::Break => e
|
|
4638
|
+
e.code_value
|
|
4639
|
+
end
|
|
4640
|
+
|
|
4641
|
+
def code_cycle(times = nil, function = nil, **globals)
|
|
4642
|
+
code_times = times.to_code
|
|
4643
|
+
code_function = function.to_code
|
|
4644
|
+
|
|
4645
|
+
if code_times.is_a?(Function)
|
|
4646
|
+
code_function = code_times
|
|
4647
|
+
code_times = Integer.new(1)
|
|
4648
|
+
elsif code_times.nothing?
|
|
4649
|
+
code_times = Integer.new(1)
|
|
4650
|
+
end
|
|
4651
|
+
|
|
4652
|
+
cycled = raw.cycle(code_times.raw)
|
|
4653
|
+
|
|
4654
|
+
if code_function.is_a?(Function)
|
|
4655
|
+
cycled.each.with_index do |code_element, index|
|
|
4656
|
+
code_function.call(
|
|
4657
|
+
arguments: List.new([code_element, Integer.new(index), self]),
|
|
4658
|
+
**globals
|
|
4659
|
+
)
|
|
4660
|
+
rescue Error::Next => e
|
|
4661
|
+
e.code_value
|
|
4662
|
+
end
|
|
4663
|
+
|
|
4664
|
+
self
|
|
4665
|
+
else
|
|
4666
|
+
List.new(cycled.to_a)
|
|
4667
|
+
end
|
|
4668
|
+
rescue Error::Break => e
|
|
4669
|
+
e.code_value
|
|
4670
|
+
end
|
|
4671
|
+
|
|
4672
|
+
def code_transpose
|
|
4673
|
+
List.new(raw.map(&:raw).transpose)
|
|
4674
|
+
end
|
|
4675
|
+
|
|
4676
|
+
def code_combination(size)
|
|
4677
|
+
code_size = size.to_code
|
|
4678
|
+
List.new(
|
|
4679
|
+
raw.combination(code_size.raw).map { |values| List.new(values) }
|
|
4680
|
+
)
|
|
4681
|
+
end
|
|
4682
|
+
|
|
4683
|
+
def code_permutation(size = nil)
|
|
4684
|
+
code_size = size.to_code
|
|
4685
|
+
size = code_size.nothing? ? raw.size : code_size.raw
|
|
4686
|
+
|
|
4687
|
+
List.new(raw.permutation(size).map { |values| List.new(values) })
|
|
4688
|
+
end
|
|
4689
|
+
|
|
4690
|
+
def code_product(*lists)
|
|
4691
|
+
code_lists = lists.to_code
|
|
4692
|
+
|
|
4693
|
+
List.new(
|
|
4694
|
+
raw
|
|
4695
|
+
.product(*code_lists.raw.map(&:raw))
|
|
4696
|
+
.map { |values| List.new(values) }
|
|
4697
|
+
)
|
|
4698
|
+
end
|
|
4699
|
+
|
|
4700
|
+
def code_repeated_combination(size)
|
|
4701
|
+
code_size = size.to_code
|
|
4702
|
+
|
|
4703
|
+
List.new(
|
|
4704
|
+
raw
|
|
4705
|
+
.repeated_combination(code_size.raw)
|
|
4706
|
+
.map { |values| List.new(values) }
|
|
4707
|
+
)
|
|
4708
|
+
end
|
|
4709
|
+
|
|
4710
|
+
def code_repeated_permutation(size)
|
|
4711
|
+
code_size = size.to_code
|
|
4712
|
+
|
|
4713
|
+
List.new(
|
|
4714
|
+
raw
|
|
4715
|
+
.repeated_permutation(code_size.raw)
|
|
4716
|
+
.map { |values| List.new(values) }
|
|
4717
|
+
)
|
|
4718
|
+
end
|
|
4719
|
+
|
|
1559
4720
|
def code_reverse
|
|
1560
4721
|
List.new(raw.reverse)
|
|
1561
4722
|
end
|
|
1562
4723
|
|
|
4724
|
+
def code_reverse!
|
|
4725
|
+
raw.reverse!
|
|
4726
|
+
self
|
|
4727
|
+
end
|
|
4728
|
+
|
|
4729
|
+
def code_reverse_each(argument, **globals)
|
|
4730
|
+
code_argument = argument.to_code
|
|
4731
|
+
|
|
4732
|
+
raw.reverse_each.with_index do |code_element, index|
|
|
4733
|
+
code_argument.call(
|
|
4734
|
+
arguments: List.new([code_element, Integer.new(index), self]),
|
|
4735
|
+
**globals
|
|
4736
|
+
)
|
|
4737
|
+
rescue Error::Next => e
|
|
4738
|
+
e.code_value
|
|
4739
|
+
end
|
|
4740
|
+
|
|
4741
|
+
self
|
|
4742
|
+
rescue Error::Break => e
|
|
4743
|
+
e.code_value
|
|
4744
|
+
end
|
|
4745
|
+
|
|
4746
|
+
def code_rotate(count = nil)
|
|
4747
|
+
code_count = count.to_code
|
|
4748
|
+
code_count = Integer.new(1) if code_count.nothing?
|
|
4749
|
+
|
|
4750
|
+
List.new(raw.rotate(code_count.raw))
|
|
4751
|
+
end
|
|
4752
|
+
|
|
4753
|
+
def code_rotate!(count = nil)
|
|
4754
|
+
self.raw = code_rotate(count).raw
|
|
4755
|
+
self
|
|
4756
|
+
end
|
|
4757
|
+
|
|
4758
|
+
def code_union(*lists)
|
|
4759
|
+
List.new(raw.union(*lists.to_code.raw.map(&:raw)))
|
|
4760
|
+
end
|
|
4761
|
+
|
|
4762
|
+
def code_intersection(*lists)
|
|
4763
|
+
List.new(raw.intersection(*lists.to_code.raw.map(&:raw)))
|
|
4764
|
+
end
|
|
4765
|
+
|
|
4766
|
+
def code_difference(*lists)
|
|
4767
|
+
List.new(raw.difference(*lists.to_code.raw.map(&:raw)))
|
|
4768
|
+
end
|
|
4769
|
+
|
|
4770
|
+
def code_intersect?(list)
|
|
4771
|
+
code_list = list.to_code
|
|
4772
|
+
|
|
4773
|
+
Boolean.new(raw.intersect?(code_list.raw))
|
|
4774
|
+
end
|
|
4775
|
+
|
|
4776
|
+
def code_associate(value)
|
|
4777
|
+
code_value = value.to_code
|
|
4778
|
+
pair =
|
|
4779
|
+
raw.detect do |element|
|
|
4780
|
+
element.is_a?(List) && element.raw.first == code_value
|
|
4781
|
+
end
|
|
4782
|
+
|
|
4783
|
+
pair || Nothing.new
|
|
4784
|
+
end
|
|
4785
|
+
|
|
4786
|
+
def code_right_associate(value)
|
|
4787
|
+
code_value = value.to_code
|
|
4788
|
+
pair =
|
|
4789
|
+
raw.detect do |element|
|
|
4790
|
+
element.is_a?(List) && element.raw.second == code_value
|
|
4791
|
+
end
|
|
4792
|
+
|
|
4793
|
+
pair || Nothing.new
|
|
4794
|
+
end
|
|
4795
|
+
|
|
1563
4796
|
def code_compact(argument = nil, **globals)
|
|
1564
4797
|
code_argument = argument.to_code
|
|
1565
4798
|
|
|
@@ -1729,10 +4962,62 @@ class Code
|
|
|
1729
4962
|
e.code_value
|
|
1730
4963
|
end
|
|
1731
4964
|
|
|
4965
|
+
def code_sort!(argument = nil, **globals)
|
|
4966
|
+
self.raw = code_sort(argument, **globals).raw
|
|
4967
|
+
self
|
|
4968
|
+
end
|
|
4969
|
+
|
|
4970
|
+
def code_sort_by!(argument = nil, **globals)
|
|
4971
|
+
code_sort!(argument, **globals)
|
|
4972
|
+
end
|
|
4973
|
+
|
|
1732
4974
|
def code_size
|
|
1733
4975
|
Integer.new(raw.size)
|
|
1734
4976
|
end
|
|
1735
4977
|
|
|
4978
|
+
def code_empty?
|
|
4979
|
+
Boolean.new(raw.empty?)
|
|
4980
|
+
end
|
|
4981
|
+
|
|
4982
|
+
def code_count(argument = nil, **globals)
|
|
4983
|
+
code_argument = argument.to_code
|
|
4984
|
+
|
|
4985
|
+
if code_argument.nothing?
|
|
4986
|
+
return Integer.new(raw.count)
|
|
4987
|
+
elsif code_argument.is_a?(Class)
|
|
4988
|
+
return(
|
|
4989
|
+
Integer.new(
|
|
4990
|
+
raw.count { |element| element.is_a?(code_argument.raw) }
|
|
4991
|
+
)
|
|
4992
|
+
)
|
|
4993
|
+
end
|
|
4994
|
+
|
|
4995
|
+
index = 0
|
|
4996
|
+
Integer.new(
|
|
4997
|
+
raw.count do |code_element|
|
|
4998
|
+
code_argument
|
|
4999
|
+
.call(
|
|
5000
|
+
arguments: List.new([code_element, Integer.new(index), self]),
|
|
5001
|
+
**globals
|
|
5002
|
+
)
|
|
5003
|
+
.truthy?
|
|
5004
|
+
.tap { index += 1 }
|
|
5005
|
+
rescue Error::Next => e
|
|
5006
|
+
e.code_value.truthy?.tap { index += 1 }
|
|
5007
|
+
end
|
|
5008
|
+
)
|
|
5009
|
+
rescue Error::Break => e
|
|
5010
|
+
e.code_value
|
|
5011
|
+
end
|
|
5012
|
+
|
|
5013
|
+
def code_tally
|
|
5014
|
+
Dictionary.new(raw.tally)
|
|
5015
|
+
end
|
|
5016
|
+
|
|
5017
|
+
def code_entries
|
|
5018
|
+
List.new(raw)
|
|
5019
|
+
end
|
|
5020
|
+
|
|
1736
5021
|
def code_uniq(argument = nil, **globals)
|
|
1737
5022
|
code_argument = argument.to_code
|
|
1738
5023
|
|
|
@@ -1766,12 +5051,25 @@ class Code
|
|
|
1766
5051
|
e.code_value
|
|
1767
5052
|
end
|
|
1768
5053
|
|
|
5054
|
+
def code_uniq!(argument = nil, **globals)
|
|
5055
|
+
self.raw = code_uniq(argument, **globals).raw
|
|
5056
|
+
self
|
|
5057
|
+
end
|
|
5058
|
+
|
|
1769
5059
|
def code_sum
|
|
1770
5060
|
raw.inject(&:code_plus) || Nothing.new
|
|
1771
5061
|
end
|
|
1772
5062
|
|
|
1773
|
-
def code_deep_duplicate
|
|
1774
|
-
|
|
5063
|
+
def code_deep_duplicate(seen = {})
|
|
5064
|
+
seen.compare_by_identity unless seen.compare_by_identity?
|
|
5065
|
+
return seen[self] if seen.key?(self)
|
|
5066
|
+
|
|
5067
|
+
duplicate = List.new
|
|
5068
|
+
seen[self] = duplicate
|
|
5069
|
+
duplicate.raw.concat(
|
|
5070
|
+
raw.map { |value| value.code_deep_duplicate(seen) }
|
|
5071
|
+
)
|
|
5072
|
+
duplicate
|
|
1775
5073
|
end
|
|
1776
5074
|
|
|
1777
5075
|
def code_get(argument)
|
|
@@ -1780,17 +5078,80 @@ class Code
|
|
|
1780
5078
|
raw[code_argument.raw] || Nothing.new
|
|
1781
5079
|
end
|
|
1782
5080
|
|
|
5081
|
+
def code_values_at(*indices)
|
|
5082
|
+
code_indices = indices.to_code
|
|
5083
|
+
|
|
5084
|
+
List.new(raw.values_at(*code_indices.raw.map(&:raw)))
|
|
5085
|
+
end
|
|
5086
|
+
|
|
5087
|
+
def code_slice(*arguments)
|
|
5088
|
+
code_arguments = arguments.to_code.raw
|
|
5089
|
+
|
|
5090
|
+
if code_arguments.first.is_a?(Range)
|
|
5091
|
+
range = code_arguments.first
|
|
5092
|
+
value =
|
|
5093
|
+
raw.slice(
|
|
5094
|
+
::Range.new(
|
|
5095
|
+
range.code_left.to_i,
|
|
5096
|
+
range.code_right.to_i,
|
|
5097
|
+
range.exclude_end?
|
|
5098
|
+
)
|
|
5099
|
+
)
|
|
5100
|
+
|
|
5101
|
+
return value.is_a?(::Array) ? List.new(value) : value.to_code
|
|
5102
|
+
end
|
|
5103
|
+
|
|
5104
|
+
value = raw.slice(*code_arguments.map(&:raw))
|
|
5105
|
+
value.is_a?(::Array) ? List.new(value) : value.to_code
|
|
5106
|
+
end
|
|
5107
|
+
|
|
5108
|
+
def code_slice!(*arguments)
|
|
5109
|
+
code_arguments = arguments.to_code.raw
|
|
5110
|
+
|
|
5111
|
+
if code_arguments.first.is_a?(Range)
|
|
5112
|
+
range = code_arguments.first
|
|
5113
|
+
value =
|
|
5114
|
+
raw.slice!(
|
|
5115
|
+
::Range.new(
|
|
5116
|
+
range.code_left.to_i,
|
|
5117
|
+
range.code_right.to_i,
|
|
5118
|
+
range.exclude_end?
|
|
5119
|
+
)
|
|
5120
|
+
)
|
|
5121
|
+
|
|
5122
|
+
return value.is_a?(::Array) ? List.new(value) : value.to_code
|
|
5123
|
+
end
|
|
5124
|
+
|
|
5125
|
+
value = raw.slice!(*code_arguments.map(&:raw))
|
|
5126
|
+
value.is_a?(::Array) ? List.new(value) : value.to_code
|
|
5127
|
+
end
|
|
5128
|
+
|
|
1783
5129
|
def code_set(key, value)
|
|
1784
|
-
code_key = key.to_code
|
|
5130
|
+
code_key = key.to_code
|
|
5131
|
+
return super unless code_key.is_a?(Integer)
|
|
5132
|
+
|
|
1785
5133
|
code_value = value.to_code
|
|
1786
|
-
raw[code_key.raw] = code_value
|
|
5134
|
+
raw[code_key.code_to_integer.raw] = code_value
|
|
1787
5135
|
code_value
|
|
1788
5136
|
end
|
|
1789
5137
|
|
|
1790
5138
|
def code_fetch(key)
|
|
1791
|
-
code_key = key.to_code
|
|
5139
|
+
code_key = key.to_code
|
|
5140
|
+
return super unless code_key.is_a?(Integer)
|
|
1792
5141
|
|
|
1793
|
-
raw.fetch(code_key.raw, Nothing.new)
|
|
5142
|
+
raw.fetch(code_key.code_to_integer.raw, Nothing.new)
|
|
5143
|
+
end
|
|
5144
|
+
|
|
5145
|
+
def code_to_dictionary
|
|
5146
|
+
Dictionary.new(
|
|
5147
|
+
raw.map.with_index.to_h do |element, index|
|
|
5148
|
+
if element.is_a?(List) && element.raw.many?
|
|
5149
|
+
[element.raw.first, element.raw.second]
|
|
5150
|
+
else
|
|
5151
|
+
[Integer.new(index), element]
|
|
5152
|
+
end
|
|
5153
|
+
end
|
|
5154
|
+
)
|
|
1794
5155
|
end
|
|
1795
5156
|
|
|
1796
5157
|
def any?
|