Class: Steep::AST::Types::Class

Inherits:
Object
  • Object
show all
Extended by:
SharedInstance
Includes:
Helper::NoChild
Defined in:
lib/steep/ast/types/class.rb

Constant Summary collapse

@@fvs =
Set[instance]

Instance Method Summary collapse

Methods included from SharedInstance

instance

Methods included from Helper::NoChild

#each_child, #map_type

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



11
12
13
# File 'lib/steep/ast/types/class.rb', line 11

def ==(other)
  other.is_a?(Class)
end

#free_variablesObject



31
32
33
# File 'lib/steep/ast/types/class.rb', line 31

def free_variables
  @@fvs
end

#hashObject



15
16
17
# File 'lib/steep/ast/types/class.rb', line 15

def hash
  self.class.hash
end

#levelObject



37
38
39
# File 'lib/steep/ast/types/class.rb', line 37

def level
  [0]
end

#subst(s) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/steep/ast/types/class.rb', line 21

def subst(s)
  if s.module_type
    s.module_type
  else
    self
  end
end

#to_sObject



7
8
9
# File 'lib/steep/ast/types/class.rb', line 7

def to_s
  "class"
end