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
Attributes inherited from Base
#code_object, #location, #name, #return_type, #source
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
#anon_splat?, #attribute?, #completion_item_kind, #detail, #documentation, #explicit?, #nearly?, #overloads, #parameter_names, #probe, #return_type, #signature_help, #signatures, #symbol_kind, #try_merge!, #typify
Methods inherited from Closure
Methods inherited from Base
#==, #comments, #completion_item_kind, #deprecated?, #directives, #docstring, #filename, #identity, #infer, #inspect, #macros, #maybe_directives?, #nearly?, #probe, #probed?, #proxied?, #proxy, #realize, #symbol_kind, #to_s, #try_merge!, #typify, #variable?
Methods included from Documenting
Methods included from Conversions
#completion_item, #detail, #link_documentation, #reset_conversions, #resolve_completion_item, #signature_help, #text_documentation
Methods included from Common
#binder, #comments, #context, #name, #namespace, #return_type
Constructor Details
#initialize(scope: :instance, original: nil, **splat) ⇒ MethodAlias
Returns a new instance of 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 |