Class: Array::ArrayType

Inherits:
Object
  • Object
show all
Defined in:
lib/array.rb

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ ArrayType

Returns a new instance of ArrayType.



4
5
6
# File 'lib/array.rb', line 4

def initialize type
  @type = type
end

Instance Method Details

#is_type_of?(obj) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/array.rb', line 8

def is_type_of? obj
  obj.kind_of? @type
end

#to_sObject



12
13
14
# File 'lib/array.rb', line 12

def to_s
  "Array[#{@type}]"
end