Class: ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::Enumerator

Inherits:
Enumerable
  • Object
show all
Defined in:
lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/enumerator.rb

Instance Attribute Summary

Attributes inherited from Base

#object, #organizer, #propagated_result

Instance Method Summary collapse

Methods inherited from Enumerable

#all?, #any?, #chain, #chunk, #chunk_while, #collect, #collect_concat, #compact, #count, #cycle, #detect, #drop, #drop_while, #each_with_object, #entries, #filter, #filter_map, #find, #find_all, #find_index, #first, #flat_map, #grep, #grep_v, #group_by, #include?, #inject, #lazy, #map, #max, #max_by, #member?, #min, #min_by, #minmax, #minmax_by, #none?, #one?, #partition, #reduce, #reject, #select, #slice_after, #slice_before, #slice_when, #sort, #sort_by, #sum, #take, #take_while, #tally, #to_a, #to_h, #to_set, #uniq, #zip

Methods inherited from Base

#==, #evaluate_by, #initialize, #result

Methods included from ConvenientService::Support::AbstractMethod

abstract_method

Instance Method Details

#default_data_keySymbol

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.

Returns:

  • (Symbol)


27
28
29
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/enumerator.rb', line 27

def default_data_key
  :values
end

#default_evaluate_bySymbol

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.

Returns:

  • (Symbol)


36
37
38
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/enumerator.rb', line 36

def default_evaluate_by
  :to_a
end

#each(&iteration_block) ⇒ ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::Enumerable



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/enumerator.rb', line 46

def each(&iteration_block)
  if iteration_block
    with_processing_return_value_as_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
      enumerator.each(&step_aware_iteration_block)
    end
  else
    with_processing_return_value_as_enumerator do
      enumerator.each
    end
  end
end

#each_cons(n, &iteration_block) ⇒ ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::ChainEnumerator



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/enumerator.rb', line 65

def each_cons(n, &iteration_block)
  if iteration_block
    with_processing_return_value_as_enumerator(arguments(n, &iteration_block)) do |n, &step_aware_iteration_block|
      enumerator.each_cons(n, &step_aware_iteration_block)
    end
  else
    with_processing_return_value_as_enumerator(arguments(n)) do |n|
      enumerator.each_cons(n)
    end
  end
end

#each_entry(&iteration_block) ⇒ ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::ChainEnumerator



83
84
85
86
87
88
89
90
91
92
93
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/enumerator.rb', line 83

def each_entry(&iteration_block)
  if iteration_block
    with_processing_return_value_as_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
      enumerator.each_entry(&step_aware_iteration_block)
    end
  else
    with_processing_return_value_as_enumerator do
      enumerator.each_entry
    end
  end
end

#each_slice(n, &iteration_block) ⇒ ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::ChainEnumerator



102
103
104
105
106
107
108
109
110
111
112
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/enumerator.rb', line 102

def each_slice(n, &iteration_block)
  if iteration_block
    with_processing_return_value_as_enumerator(arguments(n, &iteration_block)) do |n, &step_aware_iteration_block|
      enumerator.each_slice(n, &step_aware_iteration_block)
    end
  else
    with_processing_return_value_as_enumerator(arguments(n)) do |n|
      enumerator.each_slice(n)
    end
  end
end

#each_with_index(&iteration_block) ⇒ ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::ChainEnumerator



120
121
122
123
124
125
126
127
128
129
130
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/enumerator.rb', line 120

def each_with_index(&iteration_block)
  if iteration_block
    with_processing_return_value_as_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
      enumerator.each_with_index(&step_aware_iteration_block)
    end
  else
    with_processing_return_value_as_enumerator do
      enumerator.each_with_index
    end
  end
end

#reverse_each(&iteration_block) ⇒ ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::ChainEnumerator



138
139
140
141
142
143
144
145
146
147
148
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/enumerator.rb', line 138

def reverse_each(&iteration_block)
  if iteration_block
    with_processing_return_value_as_enumerator(arguments(&iteration_block)) do |&step_aware_iteration_block|
      enumerator.reverse_each(&step_aware_iteration_block)
    end
  else
    with_processing_return_value_as_enumerator do
      enumerator.reverse_each
    end
  end
end

#with_index(offset = nil, &iteration_block) ⇒ ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::Enumerable, ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::Enumerator



157
158
159
160
161
162
163
164
165
166
167
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/enumerator.rb', line 157

def with_index(offset = nil, &iteration_block)
  if iteration_block
    with_processing_return_value_as_enumerable(arguments(offset, &iteration_block)) do |offset, &step_aware_iteration_block|
      enumerator.with_index(offset, &step_aware_iteration_block)
    end
  else
    with_processing_return_value_as_enumerator(arguments(offset)) do |offset|
      enumerator.with_index(offset)
    end
  end
end

#with_object(obj, &iteration_block) ⇒ ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::Enumerable, ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::Enumerator



176
177
178
179
180
181
182
183
184
185
186
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/enumerator.rb', line 176

def with_object(obj, &iteration_block)
  if iteration_block
    with_processing_return_value_as_object(arguments(obj, &iteration_block)) do |obj, &step_aware_iteration_block|
      enumerator.with_object(obj, &step_aware_iteration_block)
    end
  else
    with_processing_return_value_as_enumerator(arguments(obj)) do |obj|
      enumerator.with_object(obj)
    end
  end
end