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
#configuration, #location, #name, #uri, #visibility
Instance Method Summary collapse
-
#ancestor_hash ⇒ Object
: -> Integer.
-
#initialize(configuration, nesting, uri, location, name_location, comments) ⇒ Namespace
constructor
: (Configuration configuration, 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(configuration, nesting, uri, location, name_location, comments) ⇒ Namespace
: (Configuration configuration, Array nesting, URI::Generic uri, Location location, Location name_location, String? comments) -> void
129 130 131 132 133 134 135 136 137 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 129 def initialize(configuration, nesting, uri, location, name_location, comments) # rubocop:disable Metrics/ParameterLists @name = nesting.join("::") #: String # The original nesting where this namespace was discovered @nesting = nesting super(configuration, @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
126 127 128 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 126 def name_location @name_location end |
#nesting ⇒ Object (readonly)
: Array
122 123 124 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 122 def nesting @nesting end |
Instance Method Details
#ancestor_hash ⇒ Object
: -> Integer
153 154 155 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 153 def ancestor_hash mixin_operation_module_names.hash end |
#mixin_operation_module_names ⇒ Object
: -> Array
140 141 142 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 140 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
148 149 150 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 148 def mixin_operations @mixin_operations ||= [] #: Array[ModuleOperation]? end |