Class: Moult::Index::Definition
- Inherits:
-
Struct
- Object
- Struct
- Moult::Index::Definition
- 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
-
#name ⇒ Object
Returns the value of attribute name.
-
#override_of ⇒ Object
readonly
FQ name of the ancestor whose method this overrides/implements (reachable via that interface), else nil.
-
#owner ⇒ Object
Returns the value of attribute owner.
-
#owner_hierarchy_reference_paths ⇒ Object
readonly
for methods: root-relative paths referencing the owner type or any descendant, excluding the hierarchy's own definition files.
-
#path ⇒ Object
Returns the value of attribute path.
-
#reference_count ⇒ Object
readonly
resolvable usages of this definition.
-
#reference_paths ⇒ Object
readonly
root-relative paths that use it.
-
#span ⇒ Object
Returns the value of attribute span.
-
#symbol_id ⇒ Object
Returns the value of attribute symbol_id.
-
#unqualified_name ⇒ Object
Returns the value of attribute unqualified_name.
Instance Method Summary collapse
-
#kind(value) ⇒ Object
:method or :constant.
-
#singleton(value) ⇒ Object
true for Class.method / constants.
-
#visibility(value) ⇒ Object
:public, :private, :protected.
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
39 40 41 |
# File 'lib/moult/index.rb', line 39 def name @name end |
#override_of ⇒ Object (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 ) |
#owner ⇒ Object
Returns the value of attribute owner
39 40 41 |
# File 'lib/moult/index.rb', line 39 def owner @owner end |
#owner_hierarchy_reference_paths ⇒ Object (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 ) |
#path ⇒ Object
Returns the value of attribute path
39 40 41 |
# File 'lib/moult/index.rb', line 39 def path @path end |
#reference_count ⇒ Object (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_paths ⇒ Object (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 ) |
#span ⇒ Object
Returns the value of attribute span
39 40 41 |
# File 'lib/moult/index.rb', line 39 def span @span end |
#symbol_id ⇒ Object
Returns the value of attribute symbol_id
39 40 41 |
# File 'lib/moult/index.rb', line 39 def symbol_id @symbol_id end |
#unqualified_name ⇒ Object
Returns the value of attribute 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 ) |