Class: Docit::SystemGraph::RailsAnalyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/docit/system_graph/rails_analyzer.rb

Constant Summary collapse

VALID_METHODS =
%w[get post put patch delete].freeze
SKIP_PREFIXES =
%w[docit/ rails/ active_storage/ action_mailbox/].freeze

Instance Method Summary collapse

Constructor Details

#initialize(graph: Graph.new, scanner: SourceScanner.new(root: Rails.root)) ⇒ RailsAnalyzer

Returns a new instance of RailsAnalyzer.



9
10
11
12
# File 'lib/docit/system_graph/rails_analyzer.rb', line 9

def initialize(graph: Graph.new, scanner: SourceScanner.new(root: Rails.root))
  @graph = graph
  @scanner = scanner
end

Instance Method Details

#analyzeObject



14
15
16
17
18
19
20
# File 'lib/docit/system_graph/rails_analyzer.rb', line 14

def analyze
  add_routes_and_actions
  add_schemas
  add_models
  add_source_nodes
  graph
end