Class: Woods::RubyAnalyzer::MethodAnalyzer
- Inherits:
-
Object
- Object
- Woods::RubyAnalyzer::MethodAnalyzer
- Includes:
- FqnBuilder
- Defined in:
- lib/woods/ruby_analyzer/method_analyzer.rb
Overview
Extracts method-level units from Ruby source code.
For each class/module, extracts methods as ExtractedUnit objects with type :ruby_method. Includes visibility, parameters, call graph, and dependencies.
Defined Under Namespace
Classes: VisibilityTracker
Instance Method Summary collapse
-
#analyze(source:, file_path:) ⇒ Array<ExtractedUnit>
Analyze source code and extract method units.
-
#initialize(parser: nil) ⇒ MethodAnalyzer
constructor
A new instance of MethodAnalyzer.
Constructor Details
#initialize(parser: nil) ⇒ MethodAnalyzer
Returns a new instance of MethodAnalyzer.
25 26 27 28 |
# File 'lib/woods/ruby_analyzer/method_analyzer.rb', line 25 def initialize(parser: nil) @parser = parser || Ast::Parser.new @call_site_extractor = Ast::CallSiteExtractor.new end |
Instance Method Details
#analyze(source:, file_path:) ⇒ Array<ExtractedUnit>
Analyze source code and extract method units.
35 36 37 38 39 40 |
# File 'lib/woods/ruby_analyzer/method_analyzer.rb', line 35 def analyze(source:, file_path:) root = @parser.parse(source) units = [] extract_methods_from_tree(root, source, file_path, [], units) units end |