Class: RubyIndexer::Entry

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/ruby_indexer/lib/ruby_indexer/entry.rb

Direct Known Subclasses

Alias, Constant, Method, Namespace, UnresolvedAlias

Defined Under Namespace

Classes: Alias, Class, Constant, InstanceMethod, Method, Module, Namespace, Parameter, RequiredParameter, SingletonMethod, UnresolvedAlias

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, file_path, location, comments) ⇒ Entry

Returns a new instance of Entry.



24
25
26
27
28
29
30
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 24

def initialize(name, file_path, location, comments)
  @name = name
  @file_path = file_path
  @location = location
  @comments = comments
  @visibility = T.let(:public, Symbol)
end

Instance Attribute Details

#commentsObject (readonly)

Returns the value of attribute comments.



18
19
20
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 18

def comments
  @comments
end

#file_pathObject (readonly)

Returns the value of attribute file_path.



12
13
14
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 12

def file_path
  @file_path
end

#locationObject (readonly)

Returns the value of attribute location.



15
16
17
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 15

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 9

def name
  @name
end

#visibilityObject

Returns the value of attribute visibility.



21
22
23
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 21

def visibility
  @visibility
end

Instance Method Details

#file_nameObject



33
34
35
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 33

def file_name
  File.basename(@file_path)
end