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



33
34
35
# File 'lib/moult/index.rb', line 33

def name
  @name
end

#override_ofObject (readonly)

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



33
34
35
36
37
# File 'lib/moult/index.rb', line 33

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

#ownerObject

Returns the value of attribute owner

Returns:

  • (Object)

    the current value of owner



33
34
35
# File 'lib/moult/index.rb', line 33

def owner
  @owner
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



33
34
35
# File 'lib/moult/index.rb', line 33

def path
  @path
end

#reference_countObject (readonly)

resolvable usages of this definition



33
34
35
36
37
# File 'lib/moult/index.rb', line 33

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

#reference_pathsObject (readonly)

root-relative paths that use it



33
34
35
36
37
# File 'lib/moult/index.rb', line 33

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

#spanObject

Returns the value of attribute span

Returns:

  • (Object)

    the current value of span



33
34
35
# File 'lib/moult/index.rb', line 33

def span
  @span
end

#symbol_idObject

Returns the value of attribute symbol_id

Returns:

  • (Object)

    the current value of symbol_id



33
34
35
# File 'lib/moult/index.rb', line 33

def symbol_id
  @symbol_id
end

#unqualified_nameObject

Returns the value of attribute unqualified_name

Returns:

  • (Object)

    the current value of unqualified_name



33
34
35
# File 'lib/moult/index.rb', line 33

def unqualified_name
  @unqualified_name
end

Instance Method Details

#kind=(value) ⇒ Object

:method or :constant



33
34
35
36
37
# File 'lib/moult/index.rb', line 33

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

#singleton=(value) ⇒ Object

true for Class.method / constants



33
34
35
36
37
# File 'lib/moult/index.rb', line 33

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

#visibility=(value) ⇒ Object

:public, :private, :protected



33
34
35
36
37
# File 'lib/moult/index.rb', line 33

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