Class: RubyIndexer::Entry::Member

Inherits:
RubyIndexer::Entry show all
Extended by:
T::Helpers, T::Sig
Defined in:
lib/ruby_indexer/lib/ruby_indexer/entry.rb

Direct Known Subclasses

Accessor, Method

Instance Attribute Summary collapse

Attributes inherited from RubyIndexer::Entry

#comments, #file_path, #location, #name, #visibility

Instance Method Summary collapse

Methods inherited from RubyIndexer::Entry

#file_name, #private?, #protected?, #public?

Constructor Details

#initialize(name, file_path, location, comments, visibility, owner) ⇒ Member

rubocop:disable Metrics/ParameterLists



329
330
331
332
333
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 329

def initialize(name, file_path, location, comments, visibility, owner) # rubocop:disable Metrics/ParameterLists
  super(name, file_path, location, comments)
  @visibility = visibility
  @owner = owner
end

Instance Attribute Details

#ownerObject (readonly)

Returns the value of attribute owner.



312
313
314
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 312

def owner
  @owner
end

Instance Method Details

#decorated_parametersObject



339
340
341
342
343
344
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 339

def decorated_parameters
  first_signature = signatures.first
  return "()" unless first_signature

  "(#{first_signature.format})"
end

#formatted_signaturesObject



347
348
349
350
351
352
353
354
355
356
357
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 347

def formatted_signatures
  overloads_count = signatures.size
  case overloads_count
  when 1
    ""
  when 2
    "\n(+1 overload)"
  else
    "\n(+#{overloads_count - 1} overloads)"
  end
end

#parametersObject



315
316
317
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 315

def parameters
  T.must(signatures.first).parameters
end

#signaturesObject



336
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 336

def signatures; end