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 191 def initialize(element_type, enumeration) 192 @element_type = element_type 193 @enumeration = enumeration 194 end
Public Instance Methods
all?(&block)
click to toggle source
# File lib/puppet/pops/types/iterable.rb 224 def all?(&block) 225 @enumeration.all?(&block) 226 end
any?(&block)
click to toggle source
# File lib/puppet/pops/types/iterable.rb 228 def any?(&block) 229 @enumeration.any?(&block) 230 end
element_type()
click to toggle source
# File lib/puppet/pops/types/iterable.rb 196 def element_type 197 @element_type 198 end
map(*args, &block)
click to toggle source
# File lib/puppet/pops/types/iterable.rb 216 def map(*args, &block) 217 @enumeration.map(*args, &block) 218 end
method_missing(name, *arguments, &block)
click to toggle source
# File lib/puppet/pops/types/iterable.rb 208 def method_missing(name, *arguments, &block) 209 @enumeration.send(name, *arguments, &block) 210 end
next()
click to toggle source
# File lib/puppet/pops/types/iterable.rb 212 def next 213 @enumeration.next 214 end
reduce(*args, &block)
click to toggle source
# File lib/puppet/pops/types/iterable.rb 220 def reduce(*args, &block) 221 @enumeration.reduce(*args, &block) 222 end
respond_to_missing?(name, include_private)
click to toggle source
# File lib/puppet/pops/types/iterable.rb 204 def respond_to_missing?(name, include_private) 205 @enumeration.respond_to?(name, include_private) 206 end
reverse_each(&block)
click to toggle source
# File lib/puppet/pops/types/iterable.rb 252 def reverse_each(&block) 253 r = Iterator.new(@element_type, @enumeration.reverse_each) 254 block_given? ? r.each(&block) : r 255 end
size()
click to toggle source
# File lib/puppet/pops/types/iterable.rb 200 def size 201 @enumeration.size 202 end
step(step) { |next| ... }
click to toggle source
# File lib/puppet/pops/types/iterable.rb 232 def step(step, &block) 233 raise ArgumentError if step <= 0 234 r = self 235 r = r.step_iterator(step) if step > 1 236 237 if block_given? 238 begin 239 if block.arity == 1 240 loop { yield(r.next) } 241 else 242 loop { yield(*r.next) } 243 end 244 rescue StopIteration 245 end 246 self 247 else 248 r 249 end 250 end
step_iterator(step)
click to toggle source
# File lib/puppet/pops/types/iterable.rb 257 def step_iterator(step) 258 StepIterator.new(@element_type, self, step) 259 end
to_s()
click to toggle source
# File lib/puppet/pops/types/iterable.rb 261 def to_s 262 et = element_type 263 et.nil? ? 'Iterator-Value' : "Iterator[#{et.generalize}]-Value" 264 end
unbounded?()
click to toggle source
# File lib/puppet/pops/types/iterable.rb 266 def unbounded? 267 Iterable.unbounded?(@enumeration) 268 end