Class: RouteMechanic::Testing::ErrorAggregator
- Inherits:
-
Object
- Object
- RouteMechanic::Testing::ErrorAggregator
- Defined in:
- lib/route_mechanic/testing/error_aggregator.rb
Instance Attribute Summary collapse
-
#unused_actions_errors ⇒ Object
readonly
Returns the value of attribute unused_actions_errors.
-
#unused_routes_errors ⇒ Object
readonly
Returns the value of attribute unused_routes_errors.
Instance Method Summary collapse
- #aggregate(unused_actions: true, unused_routes: true) ⇒ Object
- #all_routes ⇒ Array<ActionDispatch::Journey::Route>
- #error_message ⇒ String
-
#initialize(routes, controllers) ⇒ ErrorAggregator
constructor
A new instance of ErrorAggregator.
- #no_error? ⇒ Boolean
Constructor Details
#initialize(routes, controllers) ⇒ ErrorAggregator
Returns a new instance of ErrorAggregator.
10 11 12 13 14 15 16 17 |
# File 'lib/route_mechanic/testing/error_aggregator.rb', line 10 def initialize(routes, controllers) @routes = routes @controllers = controllers @config_routes = [] @controller_routes = [] @unused_routes_errors = [] @unused_actions_errors = [] end |
Instance Attribute Details
#unused_actions_errors ⇒ Object (readonly)
Returns the value of attribute unused_actions_errors.
6 7 8 |
# File 'lib/route_mechanic/testing/error_aggregator.rb', line 6 def unused_actions_errors @unused_actions_errors end |
#unused_routes_errors ⇒ Object (readonly)
Returns the value of attribute unused_routes_errors.
6 7 8 |
# File 'lib/route_mechanic/testing/error_aggregator.rb', line 6 def unused_routes_errors @unused_routes_errors end |
Instance Method Details
#aggregate(unused_actions: true, unused_routes: true) ⇒ Object
21 22 23 24 25 |
# File 'lib/route_mechanic/testing/error_aggregator.rb', line 21 def aggregate(unused_actions: true, unused_routes: true) collect_unused_actions_errors(unused_actions) collect_unused_routes_errors(unused_routes) self end |
#all_routes ⇒ Array<ActionDispatch::Journey::Route>
28 29 30 |
# File 'lib/route_mechanic/testing/error_aggregator.rb', line 28 def all_routes @config_routes + @controller_routes end |
#error_message ⇒ String
38 39 40 |
# File 'lib/route_mechanic/testing/error_aggregator.rb', line 38 def ErrorInspector.new(self). end |
#no_error? ⇒ Boolean
33 34 35 |
# File 'lib/route_mechanic/testing/error_aggregator.rb', line 33 def no_error? [@unused_routes_errors, @unused_actions_errors].all?(&:empty?) end |