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

Inherits:
Object
  • Object
show all
Extended by:
SharedInstance
Includes:
Helper::NoChild
Defined in:
lib/steep/ast/types/self.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?



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

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

#free_variablesObject



33
34
35
# File 'lib/steep/ast/types/self.rb', line 33

def free_variables
  @@fvs
end

#hashObject



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

def hash
  self.class.hash
end

#levelObject



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

def level
  [0]
end

#subst(s) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/steep/ast/types/self.rb', line 23

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

#to_sObject



17
18
19
# File 'lib/steep/ast/types/self.rb', line 17

def to_s
  "self"
end