Class: Steep::AST::Types::Name::Module

Inherits:
Base
  • Object
show all
Defined in:
lib/steep/ast/types/name.rb

Instance Attribute Summary

Attributes inherited from Base

#location, #name

Instance Method Summary collapse

Methods inherited from Base

#free_variables, #initialize, #level, #subst

Constructor Details

This class inherits a constructor from Steep::AST::Types::Name::Base

Instance Method Details

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



131
132
133
134
# File 'lib/steep/ast/types/name.rb', line 131

def ==(other)
  other.class == self.class &&
    other.name == name
end

#hashObject



138
139
140
# File 'lib/steep/ast/types/name.rb', line 138

def hash
  self.class.hash ^ name.hash
end

#to_sObject



142
143
144
# File 'lib/steep/ast/types/name.rb', line 142

def to_s
  "singleton(#{name.to_s})"
end

#with_location(new_location) ⇒ Object



146
147
148
# File 'lib/steep/ast/types/name.rb', line 146

def with_location(new_location)
  self.class.new(name: name, location: new_location)
end