class KXI::Collections::ProtectedCollection

Represents a collection that can only be enumerated

Public Class Methods

new(enum = []) click to toggle source

Instantiates the {KXI::Collections::ArrayCollection} class @param enum [KXI::Collections::Enumerable] Protected enumerable

Calls superclass method KXI::Collections::Enumerable::new
# File lib/kxi/collections/protected_collection.rb, line 9
def initialize(enum = [])
        super()
        @enum = enum
end

Public Instance Methods

create_enumerator() click to toggle source

Creates a new {KXI::Collections::Enumerator} bound to this instance @return [KXI::Collections::Enumerator] Enumerator bound to this instance

# File lib/kxi/collections/protected_collection.rb, line 16
def create_enumerator
        @enum.create_enumerator
end