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

#configuration, #location, #name, #uri, #visibility

Instance Method Summary collapse

Methods inherited from RubyIndexer::Entry

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

Constructor Details

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

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



293
294
295
296
297
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 293

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

Instance Attribute Details

#ownerObject (readonly)

: Entry::Namespace?



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

def owner
  @owner
end

Instance Method Details

#decorated_parametersObject

: -> String



306
307
308
309
310
311
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 306

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

  "(#{first_signature.format})"
end

#formatted_signaturesObject

: -> String



314
315
316
317
318
319
320
321
322
323
324
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 314

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)


301
302
303
# File 'lib/ruby_indexer/lib/ruby_indexer/entry.rb', line 301

def signatures
  raise AbstractMethodInvokedError
end