Class: Ryac::ConstantInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/ryac/analysis/constant/rename_mapping.rb,
sig/ryac/analysis/constant/rename_mapping.rbs

Overview

Represents a user-defined constant found in the source file

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original_name: nil, full_path: nil, short_name: nil, usage_count: nil, definition_type: nil, scope_path: nil) ⇒ ConstantInfo

steep:ignore UndeclaredMethodDefinition

Parameters:

  • original_name: (Symbol, nil) (defaults to: nil)
  • full_path: (Array[Symbol], nil) (defaults to: nil)
  • short_name: (String, nil) (defaults to: nil)
  • usage_count: (Integer, nil) (defaults to: nil)
  • definition_type: (Symbol, nil) (defaults to: nil)
  • scope_path: (Array[Symbol], nil) (defaults to: nil)


36
37
38
39
40
41
42
43
44
45
# File 'lib/ryac/analysis/constant/rename_mapping.rb', line 36

def initialize(original_name: nil, full_path: nil, short_name: nil, # steep:ignore UndeclaredMethodDefinition
               usage_count: nil, definition_type: nil, scope_path: nil)
  # @type self: ConstantInfo
  self.original_name = original_name
  self.full_path = full_path || []
  self.short_name = short_name
  self.usage_count = usage_count || 0
  self.definition_type = definition_type
  self.scope_path = scope_path || []
end

Instance Attribute Details

#definition_type ⇒ Object

Returns the value of attribute definition_type

Returns:

  • (Object) —

    the current value of definition_type



27
28
29
# File 'lib/ryac/analysis/constant/rename_mapping.rb', line 27

def definition_type
  @definition_type
end

#full_path ⇒ Object

Returns the value of attribute full_path

Returns:

  • (Object) —

    the current value of full_path



27
28
29
# File 'lib/ryac/analysis/constant/rename_mapping.rb', line 27

def full_path
  @full_path
end

#original_name ⇒ Object

Returns the value of attribute original_name

Returns:

  • (Object) —

    the current value of original_name



27
28
29
# File 'lib/ryac/analysis/constant/rename_mapping.rb', line 27

def original_name
  @original_name
end

#scope_path ⇒ Object

Returns the value of attribute scope_path

Returns:

  • (Object) —

    the current value of scope_path



27
28
29
# File 'lib/ryac/analysis/constant/rename_mapping.rb', line 27

def scope_path
  @scope_path
end

#short_name ⇒ Object

Returns the value of attribute short_name

Returns:

  • (Object) —

    the current value of short_name



27
28
29
# File 'lib/ryac/analysis/constant/rename_mapping.rb', line 27

def short_name
  @short_name
end

#usage_count ⇒ Object

Returns the value of attribute usage_count

Returns:

  • (Object) —

    the current value of usage_count



27
28
29
# File 'lib/ryac/analysis/constant/rename_mapping.rb', line 27

def usage_count
  @usage_count
end

Class Method Details

.new ⇒ ConstantInfo

Parameters:

  • original_name: (Symbol, nil)
  • full_path: (Array[Symbol], nil)
  • short_name: (String, nil)
  • usage_count: (Integer, nil)
  • definition_type: (Symbol, nil)
  • scope_path: (Array[Symbol], nil)

Returns:



21
# File 'sig/ryac/analysis/constant/rename_mapping.rbs', line 21

def self.new: (?original_name: Symbol?, ?full_path: Array[Symbol]?, ?short_name: String?, ?usage_count: Integer?, ?definition_type: Symbol?, ?scope_path: Array[Symbol]?) -> ConstantInfo