Class: Lagoon::Analyzer::ActionControllerAnalyzer
- Inherits:
-
Object
- Object
- Lagoon::Analyzer::ActionControllerAnalyzer
- Defined in:
- lib/lagoon/analyzer/action_controller_analyzer.rb
Overview
Analyzes ActionController classes to extract metadata including methods and inheritance
Instance Method Summary collapse
-
#analyze_controller(controller, options = {}) ⇒ Hash
Analyze a single controller and return its metadata.
-
#extract_inheritance(controller, include_framework_base: false) ⇒ Array<Hash>
Extract inheritance relationship from a controller.
Instance Method Details
#analyze_controller(controller, options = {}) ⇒ Hash
Analyze a single controller and return its metadata
13 14 15 16 17 18 19 20 |
# File 'lib/lagoon/analyzer/action_controller_analyzer.rb', line 13 def analyze_controller(controller, = {}) { name: controller.name, abstract: abstract_controller?(controller), attributes: [], methods: extract_methods(controller, ) } end |
#extract_inheritance(controller, include_framework_base: false) ⇒ Array<Hash>
Extract inheritance relationship from a controller
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/lagoon/analyzer/action_controller_analyzer.rb', line 26 def extract_inheritance(controller, include_framework_base: false) return [] if controller.superclass == ActionController::Base && !include_framework_base return [] unless controller.superclass.name return [] if !include_framework_base && controller.superclass.name.start_with?('ActionController::') [{ source: controller.superclass.name, target: controller.name, type: :inheritance, label: nil }] rescue NameError [] end |