Sha256: ad5641e8819cb7faec6d708484ec2b895b410821140ee73a012bf546213bed64
Contents?: true
Size: 421 Bytes
Versions: 12
Compression:
Stored size: 421 Bytes
Contents
module Conglomerate class Array include Enumerable def initialize(type) self.type = type self.storage = [] end def <<(val) if type raise "TypeMismatch" unless val.is_a?(type) end storage << val end def empty? storage.empty? end def each(&block) storage.each(&block) end private attr_accessor :storage, :type end end
Version data entries
12 entries across 12 versions & 1 rubygems