Class: RubyIndexer::Entry::Member Abstract

Inherits:
RubyIndexer::Entry show all
Defined in:
lib/ruby_indexer/lib/ruby_indexer/entry.rb

Overview

This class is abstract.

Direct Known Subclasses

Accessor, Method

Instance Attribute Summary collapse

Attributes inherited from RubyIndexer::Entry

#location, #name, #uri, #visibility

Instance Method Summary collapse

Methods inherited from RubyIndexer::Entry

#comments, #file_name, #file_path, #private?, #protected?, #public?

Constructor Details

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

: (String name, URI::Generic uri, Location location, String? comments, Symbol visibility, Entry::Namespace? owner) -> void



289
290
291
292
293
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 289

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

Instance Attribute Details

#ownerObject (readonly)

: Entry::Namespace?



286
287
288
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 286

def owner
  @owner
end

Instance Method Details

#decorated_parametersObject

: -> String



302
303
304
305
306
307
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 302

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

  "(#{first_signature.format})"
end

#formatted_signaturesObject

: -> String



310
311
312
313
314
315
316
317
318
319
320
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 310

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

#signaturesObject

This method is abstract.

: -> Array

Raises:

  • (AbstractMethodInvokedError)


297
298
299
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 297

def signatures
  raise AbstractMethodInvokedError
end