Class: Moult::Index::Definition

Inherits:
Struct
  • Object
show all
Defined in:
lib/moult/index.rb

Overview

A definition site that is a candidate for the dead-code analysis. All fields are Moult-owned; no rubydex object leaks past this struct.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



39
40
41
# File 'lib/moult/index.rb', line 39

def name
  @name
end

#override_ofObject (readonly)

FQ name of the ancestor whose method this overrides/implements (reachable via that interface), else nil



39
40
41
42
43
44
# File 'lib/moult/index.rb', line 39

Definition = Struct.new(
  :symbol_id, :kind, :name, :unqualified_name, :owner,
  :visibility, :singleton, :span, :path,
  :reference_count, :reference_paths, :override_of,
  :owner_hierarchy_reference_paths
)

#ownerObject

Returns the value of attribute owner

Returns:

  • (Object)

    the current value of owner



39
40
41
# File 'lib/moult/index.rb', line 39

def owner
  @owner
end

#owner_hierarchy_reference_pathsObject (readonly)

for methods: root-relative paths referencing the owner type or any descendant, excluding the hierarchy's own definition files. nil when the owner is unknown or defined outside the workspace (fact unavailable), and always nil for constants (their own reference_paths already carry the signal)



39
40
41
42
43
44
# File 'lib/moult/index.rb', line 39

Definition = Struct.new(
  :symbol_id, :kind, :name, :unqualified_name, :owner,
  :visibility, :singleton, :span, :path,
  :reference_count, :reference_paths, :override_of,
  :owner_hierarchy_reference_paths
)

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



39
40
41
# File 'lib/moult/index.rb', line 39

def path
  @path
end

#reference_countObject (readonly)

resolvable usages of this definition



39
40
41
42
43
44
# File 'lib/moult/index.rb', line 39

Definition = Struct.new(
  :symbol_id, :kind, :name, :unqualified_name, :owner,
  :visibility, :singleton, :span, :path,
  :reference_count, :reference_paths, :override_of,
  :owner_hierarchy_reference_paths
)

#reference_pathsObject (readonly)

root-relative paths that use it



39
40
41
42
43
44
# File 'lib/moult/index.rb', line 39

Definition = Struct.new(
  :symbol_id, :kind, :name, :unqualified_name, :owner,
  :visibility, :singleton, :span, :path,
  :reference_count, :reference_paths, :override_of,
  :owner_hierarchy_reference_paths
)

#spanObject

Returns the value of attribute span

Returns:

  • (Object)

    the current value of span



39
40
41
# File 'lib/moult/index.rb', line 39

def span
  @span
end

#symbol_idObject

Returns the value of attribute symbol_id

Returns:

  • (Object)

    the current value of symbol_id



39
40
41
# File 'lib/moult/index.rb', line 39

def symbol_id
  @symbol_id
end

#unqualified_nameObject

Returns the value of attribute unqualified_name

Returns:

  • (Object)

    the current value of unqualified_name



39
40
41
# File 'lib/moult/index.rb', line 39

def unqualified_name
  @unqualified_name
end

Instance Method Details

#kind=(value) ⇒ Object

:method or :constant



39
40
41
42
43
44
# File 'lib/moult/index.rb', line 39

Definition = Struct.new(
  :symbol_id, :kind, :name, :unqualified_name, :owner,
  :visibility, :singleton, :span, :path,
  :reference_count, :reference_paths, :override_of,
  :owner_hierarchy_reference_paths
)

#singleton=(value) ⇒ Object

true for Class.method / constants



39
40
41
42
43
44
# File 'lib/moult/index.rb', line 39

Definition = Struct.new(
  :symbol_id, :kind, :name, :unqualified_name, :owner,
  :visibility, :singleton, :span, :path,
  :reference_count, :reference_paths, :override_of,
  :owner_hierarchy_reference_paths
)

#visibility=(value) ⇒ Object

:public, :private, :protected



39
40
41
42
43
44
# File 'lib/moult/index.rb', line 39

Definition = Struct.new(
  :symbol_id, :kind, :name, :unqualified_name, :owner,
  :visibility, :singleton, :span, :path,
  :reference_count, :reference_paths, :override_of,
  :owner_hierarchy_reference_paths
)