Class: Steep::AST::Types::Name::Singleton

Inherits:
Base show all
Includes:
Helper::NoChild
Defined in:
lib/steep/ast/types/name.rb

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods included from Helper::NoChild

#each_child, #map_type

Methods inherited from Base

#initialize, #level, #map_type, #subst

Methods included from Helper::NoFreeVariables

#free_variables

Constructor Details

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

Instance Method Details

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



96
97
98
99
# File 'lib/steep/ast/types/name.rb', line 96

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

#hashObject



103
104
105
# File 'lib/steep/ast/types/name.rb', line 103

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

#to_sObject



107
108
109
# File 'lib/steep/ast/types/name.rb', line 107

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