Class: Array

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

Defined Under Namespace

Classes: ArrayType

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.[](type) ⇒ Object



29
30
31
# File 'lib/array.rb', line 29

def self.[] type
  ArrayType.new(type)
end

Instance Method Details

#kind_of?(type) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
22
23
24
25
26
27
# File 'lib/array.rb', line 19

def kind_of? type
  if type.kind_of?(ArrayType) or type.kind_of?(VarArgs)
    self.each do |e|
      return false if not type.is_type_of?(e)
    end
  else
    orig_kind_of? type
  end
end

#orig_kind_of?Object



17
# File 'lib/array.rb', line 17

alias_method :orig_kind_of?, :kind_of?