Class: RubyIndexer::IndexablePath

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(load_path_entry, full_path) ⇒ IndexablePath

Returns a new instance of IndexablePath.



21
22
23
24
25
26
27
# File 'lib/ruby_indexer/lib/ruby_indexer/indexable_path.rb', line 21

def initialize(load_path_entry, full_path)
  @full_path = full_path
  @require_path = T.let(
    load_path_entry ? Pathname.new(full_path).relative_path_from(load_path_entry).to_s.delete_suffix(".rb") : nil,
    T.nilable(String),
  )
end

Instance Attribute Details

#full_pathObject (readonly)

Returns the value of attribute full_path.



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

def full_path
  @full_path
end

#require_pathObject (readonly)

Returns the value of attribute require_path.



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

def require_path
  @require_path
end