Class: RubyLsp::Ree::LocalVariablesParser

Inherits:
BasicParser
  • Object
show all
Defined in:
lib/ruby_lsp/ruby_lsp_ree/parsing/body_parsers/local_variables_parser.rb

Defined Under Namespace

Classes: LocalVariable

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BasicParser

#get_method_body, #node_name

Constructor Details

#initialize(method_obj) ⇒ LocalVariablesParser

Returns a new instance of LocalVariablesParser.



14
15
16
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/body_parsers/local_variables_parser.rb', line 14

def initialize(method_obj)
  @method_object = method_obj
end

Instance Attribute Details

#method_objectObject (readonly)

Returns the value of attribute method_object.



4
5
6
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/body_parsers/local_variables_parser.rb', line 4

def method_object
  @method_object
end

#parsed_docObject (readonly)

Returns the value of attribute parsed_doc.



4
5
6
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/body_parsers/local_variables_parser.rb', line 4

def parsed_doc
  @parsed_doc
end

Instance Method Details

#method_local_variablesObject



18
19
20
21
22
23
# File 'lib/ruby_lsp/ruby_lsp_ree/parsing/body_parsers/local_variables_parser.rb', line 18

def method_local_variables
  method_body = method_object.method_body
  return [] unless method_body

  parse_body_local_variables(method_body)
end