Class: Solargraph::Pin::MethodAlias

Inherits:
Method show all
Defined in:
lib/solargraph/pin/method_alias.rb

Overview

Use this class to track method aliases for later remapping. Common examples that defer mapping are aliases for superclass methods or methods from included modules.

Constant Summary

Constants included from Logging

Logging::DEFAULT_LOG_LEVEL, Logging::LOG_LEVELS

Instance Attribute Summary collapse

Attributes inherited from Method

#block, #documentation, #node, #return_type, #signature_help, #signatures

Attributes inherited from Callable

#block, #parameters, #return_type

Attributes inherited from Base

#code_object, #combine_priority, #directives, #docstring, #location, #name, #return_type, #source, #type_location

Attributes included from Common

#context, #location

Instance Method Summary collapse

Methods inherited from Method

#==, #all_rooted?, #anon_splat?, #attribute?, #block?, #combine_all_signature_pins, #combine_signatures, #combine_visibility, #combine_with, #completion_item_kind, #detail, #explicit?, #generate_signature, #inner_desc, #method_name, #nearly?, #overloads, #probe, #proxy_with_signatures, #reset_generated!, #resolve_ref_tag, #rest_of_stack, #symbol_kind, #to_rbs, #transform_types, #typify, #with_single_signature

Methods inherited from Callable

#arity, #arity_matches?, #block?, #blockless_parameters, #choose_parameters, #combine_blocks, #combine_with, #generics, #mandatory_positional_param_count, #method_name, #method_namespace, #parameter_names, #resolve_generics_from_context, #resolve_generics_from_context_until_complete, #to_rbs, #transform_types, #typify

Methods inherited from Closure

#binder, #combine_with, #context, #gates, #generic_defaults, #generics, #rbs_generics, #to_rbs

Methods inherited from Base

#==, #all_location_text, #all_rooted?, #assert_location_provided, #assert_same, #assert_same_array_content, #assert_same_count, #assert_same_macros, #assert_source_provided, #best_location, #choose, #choose_longer, #choose_node, #choose_pin_attr, #choose_pin_attr_with_same_name, #choose_priority, #closure, #combine_directives, #combine_name, #combine_return_type, #combine_with, #comments, #completion_item_kind, #deprecated?, #desc, #dodgy_return_type_source?, #erase_generics, #filename, #identity, #infer, #inner_desc, #inspect, #macros, #maybe_directives?, #nearly?, #needs_consistent_name?, #prefer_rbs_location, #presence_certain?, #probe, #probed?, #proxied?, #proxy, #rbs_location?, #realize, #reset_generated!, #resolve_generics, #resolve_generics_from_context, #symbol_kind, #to_rbs, #to_s, #transform_types, #type_desc, #typify, #variable?

Methods included from Logging

logger

Methods included from Documenting

#documentation, normalize_indentation, strip_html_comments

Methods included from Conversions

#completion_item, #completion_item_kind, #deprecated?, #detail, #link_documentation, #probed?, #proxied?, #reset_conversions, #resolve_completion_item, #signature_help, #text_documentation

Methods included from Common

#binder, #closure, #comments, #name, #namespace, #return_type, #source

Constructor Details

#initialize(scope: :instance, original: nil, **splat) ⇒ MethodAlias

Returns a new instance of MethodAlias.

Parameters:

  • scope (::Symbol) (defaults to: :instance)
  • original (String, nil) (defaults to: nil)

    The name of the original method

  • splat (Hash)

    Additional options supported by superclasses



19
20
21
22
23
# File 'lib/solargraph/pin/method_alias.rb', line 19

def initialize scope: :instance, original: nil, **splat
  super(**splat)
  @scope = scope
  @original = original
end

Instance Attribute Details

#originalString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/solargraph/pin/method_alias.rb', line 14

def original
  @original
end

#scope::Symbol (readonly)

Returns:

  • (::Symbol)


11
12
13
# File 'lib/solargraph/pin/method_alias.rb', line 11

def scope
  @scope
end

Instance Method Details

#pathObject



29
30
31
# File 'lib/solargraph/pin/method_alias.rb', line 29

def path
  @path ||= namespace + (scope == :instance ? '#' : '.') + name
end

#visibilityObject



25
26
27
# File 'lib/solargraph/pin/method_alias.rb', line 25

def visibility
  :public
end