Class: Lagoon::Parser::ControllerModelParser
- Inherits:
-
Object
- Object
- Lagoon::Parser::ControllerModelParser
- Defined in:
- lib/lagoon/parser/controller_model_parser.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ControllerModelParser
constructor
A new instance of ControllerModelParser.
- #parse ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ ControllerModelParser
Returns a new instance of ControllerModelParser.
12 13 14 15 16 17 18 |
# File 'lib/lagoon/parser/controller_model_parser.rb', line 12 def initialize( = {}) @options = .is_a?(Options) ? : Options.for(:controller_model, ) @filter = ApplicationClassFilter.new( directory: 'controllers', include_all: @options[:all_controllers] ) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/lagoon/parser/controller_model_parser.rb', line 10 def @options end |
Instance Method Details
#parse ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/lagoon/parser/controller_model_parser.rb', line 20 def parse relationships = [] warnings = [] = (warnings) load_controllers.sort_by { |controller| controller.name.to_s }.each do |controller| next if excluded?(controller) analyze_controller(controller, , relationships, warnings) end aggregated = aggregate_relationships(relationships) { relationships: aggregated, warnings: warnings, counts: { relationships: aggregated.size, skipped: warnings.size } } end |