Class: ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::LazyEnumerator
- Inherits:
-
Enumerator
- Object
- Base
- Enumerable
- Enumerator
- ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::LazyEnumerator
show all
- Defined in:
- lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb
Instance Attribute Summary
Attributes inherited from Base
#modifiers, #object, #organizer, #propagated_result
Instance Method Summary
collapse
Methods inherited from Enumerator
#default_data_key, #default_evaluate_by, #with_object
Methods inherited from Enumerable
#all?, #any?, #count, #cycle, #default_data_key, #default_evaluate_by, #detect, #each, #each_cons, #each_entry, #each_slice, #each_with_index, #each_with_object, #entries, #find, #find_index, #first, #group_by, #include?, #inject, #max, #max_by, #member?, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reduce, #reverse_each, #sort, #sort_by, #sum, #tally, #to_a, #to_h, #to_set
Methods inherited from Base
#default_data_key, #evaluate_by, #initialize, #result
abstract_method
Instance Method Details
29
30
31
32
33
34
35
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 29
def chain(*enums)
casted_enums = enums.map { |collection| cast_step_aware_enumerable(collection) }.map(&:enumerable)
with_processing_return_value_as_lazy_enumerator(arguments(*casted_enums)) do |*enums|
enumerable.chain(*enums)
end
end
|
44
45
46
47
48
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 44
def chunk(&iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.chunk(&step_aware_iteration_block)
end
end
|
56
57
58
59
60
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 56
def chunk_while(&iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.chunk_while(&step_aware_iteration_block)
end
end
|
68
69
70
71
72
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 68
def collect(&iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.collect(&step_aware_iteration_block)
end
end
|
80
81
82
83
84
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 80
def collect_concat(&iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.collect_concat(&step_aware_iteration_block)
end
end
|
91
92
93
94
95
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 91
def compact
with_processing_return_value_as_lazy_enumerator do
lazy_enumerator.compact
end
end
|
103
104
105
106
107
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 103
def drop(n)
with_processing_return_value_as_lazy_enumerator(arguments(n)) do |n|
lazy_enumerator.drop(n)
end
end
|
115
116
117
118
119
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 115
def drop_while(&iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.drop_while(&step_aware_iteration_block)
end
end
|
127
128
129
130
131
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 127
def filter(&iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.filter(&step_aware_iteration_block)
end
end
|
139
140
141
142
143
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 139
def filter_map(&iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.filter_map(&step_aware_iteration_block)
end
end
|
151
152
153
154
155
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 151
def find_all(&iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.find_all(&step_aware_iteration_block)
end
end
|
163
164
165
166
167
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 163
def flat_map(&iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.flat_map(&step_aware_iteration_block)
end
end
|
176
177
178
179
180
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 176
def grep(pattern, &iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(pattern, &iteration_block)) do |pattern, &step_aware_iteration_block|
lazy_enumerator.grep(pattern, &step_aware_iteration_block)
end
end
|
189
190
191
192
193
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 189
def grep_v(pattern, &iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(pattern, &iteration_block)) do |pattern, &step_aware_iteration_block|
lazy_enumerator.grep_v(pattern, &step_aware_iteration_block)
end
end
|
200
201
202
203
204
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 200
def lazy
with_processing_return_value_as_lazy_enumerator do
lazy_enumerator.lazy
end
end
|
212
213
214
215
216
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 212
def map(&iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.map(&step_aware_iteration_block)
end
end
|
224
225
226
227
228
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 224
def reject(&iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.reject(&step_aware_iteration_block)
end
end
|
236
237
238
239
240
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 236
def select(&iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.select(&step_aware_iteration_block)
end
end
|
This method is part of a private API.
You should avoid using this method if possible, as it may be removed or be changed in the future.
357
358
359
360
361
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 357
def select_exactly(n, &iteration_block)
with_processing_return_value_as_exactly_lazy_enumerator(n, arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.select(&step_aware_iteration_block)
end
end
|
249
250
251
252
253
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 249
def slice_after(*args, &iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(*args, &iteration_block)) do |*args, &step_aware_iteration_block|
lazy_enumerator.slice_after(*args, &step_aware_iteration_block)
end
end
|
262
263
264
265
266
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 262
def slice_before(*args, &iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(*args, &iteration_block)) do |*args, &step_aware_iteration_block|
lazy_enumerator.slice_before(*args, &step_aware_iteration_block)
end
end
|
275
276
277
278
279
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 275
def slice_when(*args, &iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(*args, &iteration_block)) do |*args, &step_aware_iteration_block|
lazy_enumerator.slice_when(*args, &step_aware_iteration_block)
end
end
|
288
289
290
291
292
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 288
def take(n, &iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(n, &iteration_block)) do |n, &step_aware_iteration_block|
lazy_enumerator.take(n, &step_aware_iteration_block)
end
end
|
300
301
302
303
304
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 300
def take_while(&iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.take_while(&step_aware_iteration_block)
end
end
|
312
313
314
315
316
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 312
def uniq(&iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
lazy_enumerator.uniq(&step_aware_iteration_block)
end
end
|
325
326
327
328
329
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 325
def with_index(offset = nil, &iteration_block)
with_processing_return_value_as_lazy_enumerator(arguments(*args, &iteration_block), method: :with_index) do |*args, &step_aware_iteration_block|
lazy_enumerator.with_index(*args, &step_aware_iteration_block)
end
end
|
338
339
340
341
342
343
344
345
346
347
348
|
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/lazy_enumerator.rb', line 338
def zip(*args, &iteration_block)
if iteration_block
with_processing_return_value_as_object(arguments(*args, &iteration_block)) do |*args, &step_aware_iteration_block|
lazy_enumerator.zip(*args, &step_aware_iteration_block)
end
else
with_processing_return_value_as_lazy_enumerator(arguments(*args)) do |*args|
lazy_enumerator.zip(*args)
end
end
end
|