Class: Solargraph::Pin::MethodAlias
- 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.
Instance Attribute Summary collapse
- #original ⇒ String readonly
- #scope ⇒ ::Symbol readonly
Attributes inherited from Method
#block, #documentation, #node, #signature_help, #signatures
Attributes inherited from Callable
#block, #parameters, #return_type
Attributes inherited from Base
#code_object, #location, #name, #return_type, #source, #type_location
Attributes included from Common
Instance Method Summary collapse
-
#initialize(scope: :instance, original: nil, **splat) ⇒ MethodAlias
constructor
A new instance of MethodAlias.
- #path ⇒ Object
- #visibility ⇒ Object
Methods inherited from Method
#==, #all_rooted?, #anon_splat?, #attribute?, #block?, #completion_item_kind, #desc, #detail, #explicit?, #generate_signature, #nearly?, #overloads, #probe, #resolve_ref_tag, #return_type, #symbol_kind, #to_rbs, #transform_types, #try_merge!, #typify, #with_single_signature
Methods inherited from Callable
#arity_matches?, #block?, #mandatory_positional_param_count, #parameter_names, #resolve_generics_from_context, #resolve_generics_from_context_until_complete, #to_rbs, #transform_types
Methods inherited from Closure
#binder, #context, #gates, #generics, #rbs_generics, #to_rbs
Methods inherited from Base
#==, #all_rooted?, #best_location, #comments, #completion_item_kind, #deprecated?, #desc, #directives, #docstring, #erase_generics, #filename, #identity, #infer, #inspect, #macros, #maybe_directives?, #nearly?, #presence_certain?, #probe, #probed?, #proxied?, #proxy, #realize, #resolve_generics, #resolve_generics_from_context, #symbol_kind, #to_rbs, #to_s, #transform_types, #try_merge!, #type_desc, #typify, #variable?
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, #comments, #name, #namespace, #return_type
Constructor Details
#initialize(scope: :instance, original: nil, **splat) ⇒ MethodAlias
16 17 18 19 20 |
# File 'lib/solargraph/pin/method_alias.rb', line 16 def initialize scope: :instance, original: nil, **splat super(**splat) @scope = scope @original = original end |
Instance Attribute Details
#original ⇒ String (readonly)
14 15 16 |
# File 'lib/solargraph/pin/method_alias.rb', line 14 def original @original end |
#scope ⇒ ::Symbol (readonly)
11 12 13 |
# File 'lib/solargraph/pin/method_alias.rb', line 11 def scope @scope end |
Instance Method Details
#path ⇒ Object
26 27 28 |
# File 'lib/solargraph/pin/method_alias.rb', line 26 def path @path ||= namespace + (scope == :instance ? '#' : '.') + name end |
#visibility ⇒ Object
22 23 24 |
# File 'lib/solargraph/pin/method_alias.rb', line 22 def visibility :public end |