Class: RouteGuard::Models::Report
- Inherits:
-
Object
- Object
- RouteGuard::Models::Report
- Defined in:
- lib/route_guard/models/report.rb
Instance Attribute Summary collapse
-
#complexity_score ⇒ Object
Returns the value of attribute complexity_score.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#issues ⇒ Object
Returns the value of attribute issues.
-
#routes ⇒ Object
Returns the value of attribute routes.
-
#stats ⇒ Object
Returns the value of attribute stats.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(routes = []) ⇒ Report
constructor
A new instance of Report.
- #passed? ⇒ Boolean
- #warnings ⇒ Object
Constructor Details
#initialize(routes = []) ⇒ Report
Returns a new instance of Report.
8 9 10 11 12 13 14 |
# File 'lib/route_guard/models/report.rb', line 8 def initialize(routes = []) @routes = routes @issues = [] @stats = {} @complexity_score = 100 @duration = 0.0 end |
Instance Attribute Details
#complexity_score ⇒ Object
Returns the value of attribute complexity_score.
6 7 8 |
# File 'lib/route_guard/models/report.rb', line 6 def complexity_score @complexity_score end |
#duration ⇒ Object
Returns the value of attribute duration.
6 7 8 |
# File 'lib/route_guard/models/report.rb', line 6 def duration @duration end |
#issues ⇒ Object
Returns the value of attribute issues.
6 7 8 |
# File 'lib/route_guard/models/report.rb', line 6 def issues @issues end |
#routes ⇒ Object
Returns the value of attribute routes.
6 7 8 |
# File 'lib/route_guard/models/report.rb', line 6 def routes @routes end |
#stats ⇒ Object
Returns the value of attribute stats.
6 7 8 |
# File 'lib/route_guard/models/report.rb', line 6 def stats @stats end |
Instance Method Details
#errors ⇒ Object
16 17 18 |
# File 'lib/route_guard/models/report.rb', line 16 def errors issues.select { |i| i.severity == :error } end |
#passed? ⇒ Boolean
24 25 26 |
# File 'lib/route_guard/models/report.rb', line 24 def passed? errors.empty? end |
#warnings ⇒ Object
20 21 22 |
# File 'lib/route_guard/models/report.rb', line 20 def warnings issues.select { |i| i.severity == :warning } end |