Class: Yoda::Model::TypeExpressions::SelfType

Inherits:
Base
  • Object
show all
Defined in:
lib/yoda/model/type_expressions/self_type.rb

Instance Method Summary collapse

Methods inherited from Base

#==, #map

Instance Method Details

#change_root(paths) ⇒ self

Parameters:

  • paths (Array<Path>)

Returns:

  • (self)


16
17
18
# File 'lib/yoda/model/type_expressions/self_type.rb', line 16

def change_root(paths)
  self
end

#eql?(another) ⇒ Boolean

Parameters:

  • another (Object)

Returns:

  • (Boolean)


6
7
8
# File 'lib/yoda/model/type_expressions/self_type.rb', line 6

def eql?(another)
  another.is_a?(SelfType)
end

#hashObject



10
11
12
# File 'lib/yoda/model/type_expressions/self_type.rb', line 10

def hash
  [self.class.name].hash
end

#resolve(registry) ⇒ Array<YARD::CodeObjects::Base>

Parameters:

  • registry (Registry)

Returns:

  • (Array<YARD::CodeObjects::Base>)


22
23
24
# File 'lib/yoda/model/type_expressions/self_type.rb', line 22

def resolve(registry)
  fail NotImplementedError
end

#to_rbs_type(env) ⇒ Object

Parameters:



32
33
34
# File 'lib/yoda/model/type_expressions/self_type.rb', line 32

def to_rbs_type(env)
  RBS::Types::Bases::Self.new(location: nil)
end

#to_sString

Returns:

  • (String)


27
28
29
# File 'lib/yoda/model/type_expressions/self_type.rb', line 27

def to_s
  'self'
end