class Conglomerate::Array
Attributes
storage[RW]
type[RW]
Public Class Methods
new(type)
click to toggle source
# File lib/conglomerate/array.rb, line 5 def initialize(type) self.type = type self.storage = [] end
Public Instance Methods
<<(val)
click to toggle source
# File lib/conglomerate/array.rb, line 10 def <<(val) if type raise "TypeMismatch" unless val.is_a?(type) end storage << val end
each(&block)
click to toggle source
# File lib/conglomerate/array.rb, line 22 def each(&block) storage.each(&block) end
empty?()
click to toggle source
# File lib/conglomerate/array.rb, line 18 def empty? storage.empty? end