Class: RubyIndexer::Entry::Namespace
- Inherits:
-
RubyIndexer::Entry
- Object
- RubyIndexer::Entry
- RubyIndexer::Entry::Namespace
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/ruby_indexer/lib/ruby_indexer/entry.rb
Instance Attribute Summary collapse
-
#name_location ⇒ Object
readonly
Returns the value of attribute name_location.
-
#nesting ⇒ Object
readonly
Returns the value of attribute nesting.
Attributes inherited from RubyIndexer::Entry
#comments, #file_path, #location, #name, #visibility
Instance Method Summary collapse
- #ancestor_hash ⇒ Object
-
#initialize(nesting, file_path, location, name_location, comments) ⇒ Namespace
constructor
A new instance of Namespace.
- #mixin_operation_module_names ⇒ Object
- #mixin_operations ⇒ Object
Methods inherited from RubyIndexer::Entry
#file_name, #private?, #protected?, #public?
Constructor Details
#initialize(nesting, file_path, location, name_location, comments) ⇒ Namespace
Returns a new instance of Namespace.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 122 def initialize(nesting, file_path, location, name_location, comments) @name = T.let(nesting.join("::"), String) # The original nesting where this namespace was discovered @nesting = nesting super(@name, file_path, location, comments) @name_location = T.let( if name_location.is_a?(Prism::Location) Location.new( name_location.start_line, name_location.end_line, name_location.start_column, name_location.end_column, ) else name_location end, RubyIndexer::Location, ) end |
Instance Attribute Details
#name_location ⇒ Object (readonly)
Returns the value of attribute name_location.
111 112 113 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 111 def name_location @name_location end |
#nesting ⇒ Object (readonly)
Returns the value of attribute nesting.
107 108 109 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 107 def nesting @nesting end |
Instance Method Details
#ancestor_hash ⇒ Object
158 159 160 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 158 def ancestor_hash mixin_operation_module_names.hash end |
#mixin_operation_module_names ⇒ Object
145 146 147 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 145 def mixin_operation_module_names mixin_operations.map(&:module_name) end |
#mixin_operations ⇒ Object
153 154 155 |
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 153 def mixin_operations @mixin_operations ||= T.let([], T.nilable(T::Array[ModuleOperation])) end |