123456789_123456789_123456789_123456789_123456789_

Class: RBS::AST::Ruby::Declarations::ClassDecl::SuperClass

Relationships & Source Files
Inherits: Object
Defined in: lib/rbs/ast/ruby/declarations.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(type_name_location, operator_location, type_name, type_annotation) ⇒ SuperClass

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/declarations.rb', line 28

def initialize(type_name_location, operator_location, type_name, type_annotation)
  @type_name_location = type_name_location
  @operator_location = operator_location
  @type_name = type_name
  @type_annotation = type_annotation
end

Instance Attribute Details

#name (readonly)

Alias for #type_name.

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/declarations.rb', line 55

alias name type_name

#operator_location (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/declarations.rb', line 22

attr_reader :operator_location

#type_annotation (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/declarations.rb', line 26

attr_reader :type_annotation

#type_name (readonly) Also known as: #name

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/declarations.rb', line 24

attr_reader :type_name

#type_name_location (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/declarations.rb', line 20

attr_reader :type_name_location

Instance Method Details

#args

Alias for #type_args.

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/declarations.rb', line 56

alias args type_args

#location

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/declarations.rb', line 43

def location
  if type_annotation
    Location.new(
      type_name_location.buffer,
      type_name_location.start_pos,
      type_annotation.location.end_pos
    )
  else
    type_name_location
  end
end

#type_args Also known as: #args

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/declarations.rb', line 35

def type_args
  if type_annotation
    type_annotation.type_args
  else
    []
  end
end

#type_fingerprint

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/declarations.rb', line 58

def type_fingerprint
  [
    type_name.to_s,
    type_annotation&.type_fingerprint
  ]
end