Class: RubyIndexer::Entry::Namespace Abstract
- Inherits:
-
RubyIndexer::Entry
- Object
- RubyIndexer::Entry
- RubyIndexer::Entry::Namespace
- Defined in:
- lib/ruby_indexer/lib/ruby_indexer/entry.rb
Overview
Instance Attribute Summary collapse
-
#name_location ⇒ Object
readonly
Returns the location of the constant name, excluding the parent class or the body : Location.
-
#nesting ⇒ Object
readonly
: Array.
Attributes inherited from RubyIndexer::Entry
#location, #name, #uri, #visibility
Instance Method Summary collapse
-
#ancestor_hash ⇒ Object
: -> Integer.
-
#initialize(nesting, uri, location, name_location, comments) ⇒ Namespace
constructor
: (Array nesting, URI::Generic uri, Location location, Location name_location, String? comments) -> void.
-
#mixin_operation_module_names ⇒ Object
: -> Array.
-
#mixin_operations ⇒ Object
Stores all explicit prepend, include and extend operations in the exact order they were discovered in the source code.
Methods inherited from RubyIndexer::Entry
#comments, #file_name, #file_path, #private?, #protected?, #public?
Constructor Details
#initialize(nesting, uri, location, name_location, comments) ⇒ Namespace
: (Array nesting, URI::Generic uri, Location location, Location name_location, String? comments) -> void
125 126 127 128 129 130 131 132 133 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 125 def initialize(nesting, uri, location, name_location, comments) @name = nesting.join("::") #: String # The original nesting where this namespace was discovered @nesting = nesting super(@name, uri, location, comments) @name_location = name_location end |
Instance Attribute Details
#name_location ⇒ Object (readonly)
Returns the location of the constant name, excluding the parent class or the body : Location
122 123 124 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 122 def name_location @name_location end |
#nesting ⇒ Object (readonly)
: Array
118 119 120 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 118 def nesting @nesting end |
Instance Method Details
#ancestor_hash ⇒ Object
: -> Integer
149 150 151 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 149 def ancestor_hash mixin_operation_module_names.hash end |
#mixin_operation_module_names ⇒ Object
: -> Array
136 137 138 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 136 def mixin_operation_module_names mixin_operations.map(&:module_name) end |
#mixin_operations ⇒ Object
Stores all explicit prepend, include and extend operations in the exact order they were discovered in the source code. Maintaining the order is essential to linearize ancestors the right way when a module is both included and prepended : -> Array
144 145 146 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 144 def mixin_operations @mixin_operations ||= [] #: Array[ModuleOperation]? end |