class Puppet::Pops::Types::Iterator

@api private

Public Class Methods

new(element_type, enumeration) click to toggle source
    # File lib/puppet/pops/types/iterable.rb
190 def initialize(element_type, enumeration)
191   @element_type = element_type
192   @enumeration = enumeration
193 end

Public Instance Methods

all?(&block) click to toggle source
    # File lib/puppet/pops/types/iterable.rb
223 def all?(&block)
224   @enumeration.all?(&block)
225 end
any?(&block) click to toggle source
    # File lib/puppet/pops/types/iterable.rb
227 def any?(&block)
228   @enumeration.any?(&block)
229 end
element_type() click to toggle source
    # File lib/puppet/pops/types/iterable.rb
195 def element_type
196   @element_type
197 end
map(*args, &block) click to toggle source
    # File lib/puppet/pops/types/iterable.rb
215 def map(*args, &block)
216   @enumeration.map(*args, &block)
217 end
method_missing(name, *arguments, &block) click to toggle source
    # File lib/puppet/pops/types/iterable.rb
207 def method_missing(name, *arguments, &block)
208   @enumeration.send(name, *arguments, &block)
209 end
next() click to toggle source
    # File lib/puppet/pops/types/iterable.rb
211 def next
212   @enumeration.next
213 end
reduce(*args, &block) click to toggle source
    # File lib/puppet/pops/types/iterable.rb
219 def reduce(*args, &block)
220   @enumeration.reduce(*args, &block)
221 end
respond_to_missing?(name, include_private) click to toggle source
    # File lib/puppet/pops/types/iterable.rb
203 def respond_to_missing?(name, include_private)
204   @enumeration.respond_to?(name, include_private)
205 end
reverse_each(&block) click to toggle source
    # File lib/puppet/pops/types/iterable.rb
251 def reverse_each(&block)
252   r = Iterator.new(@element_type, @enumeration.reverse_each)
253   block_given? ? r.each(&block) : r
254 end
size() click to toggle source
    # File lib/puppet/pops/types/iterable.rb
199 def size
200   @enumeration.size
201 end
step(step) { |next| ... } click to toggle source
    # File lib/puppet/pops/types/iterable.rb
231 def step(step, &block)
232   raise ArgumentError if step <= 0
233   r = self
234   r = r.step_iterator(step) if step > 1
235 
236   if block_given?
237     begin
238     if block.arity == 1
239       loop { yield(r.next) }
240     else
241       loop { yield(*r.next) }
242     end
243     rescue StopIteration
244     end
245     self
246   else
247     r
248   end
249 end
step_iterator(step) click to toggle source
    # File lib/puppet/pops/types/iterable.rb
256 def step_iterator(step)
257   StepIterator.new(@element_type, self, step)
258 end
to_s() click to toggle source
    # File lib/puppet/pops/types/iterable.rb
260 def to_s
261   et = element_type
262   et.nil? ? 'Iterator-Value' : "Iterator[#{et.generalize}]-Value"
263 end
unbounded?() click to toggle source
    # File lib/puppet/pops/types/iterable.rb
265 def unbounded?
266   Iterable.unbounded?(@enumeration)
267 end