Class: Minitest::Metz::ScanResults
- Inherits:
-
Object
- Object
- Minitest::Metz::ScanResults
- Defined in:
- lib/minitest/metz/scan_results.rb
Instance Attribute Summary collapse
-
#first_rule ⇒ Object
readonly
Returns the value of attribute first_rule.
-
#misindentation ⇒ Object
readonly
Returns the value of attribute misindentation.
-
#second_rule ⇒ Object
readonly
Returns the value of attribute second_rule.
-
#third_rule ⇒ Object
readonly
Returns the value of attribute third_rule.
Instance Method Summary collapse
- #all_valid? ⇒ Boolean
- #first_rule_valid? ⇒ Boolean
-
#initialize(results) ⇒ ScanResults
constructor
A new instance of ScanResults.
- #misidentation_valid? ⇒ Boolean
- #second_rule_valid? ⇒ Boolean
- #third_rule_valid? ⇒ Boolean
Constructor Details
#initialize(results) ⇒ ScanResults
Returns a new instance of ScanResults.
7 8 9 10 11 12 |
# File 'lib/minitest/metz/scan_results.rb', line 7 def initialize(results) @first_rule = results[:first_rule][:total_classes_amount] - results[:first_rule][:small_classes_amount] @misindentation = results[:first_rule][:misindented_classes_amount] @second_rule = results[:second_rule][:total_methods_amount] - results[:second_rule][:small_methods_amount] @third_rule = results[:third_rule][:total_method_calls] - results[:third_rule][:proper_method_calls] end |
Instance Attribute Details
#first_rule ⇒ Object (readonly)
Returns the value of attribute first_rule.
5 6 7 |
# File 'lib/minitest/metz/scan_results.rb', line 5 def first_rule @first_rule end |
#misindentation ⇒ Object (readonly)
Returns the value of attribute misindentation.
5 6 7 |
# File 'lib/minitest/metz/scan_results.rb', line 5 def misindentation @misindentation end |
#second_rule ⇒ Object (readonly)
Returns the value of attribute second_rule.
5 6 7 |
# File 'lib/minitest/metz/scan_results.rb', line 5 def second_rule @second_rule end |
#third_rule ⇒ Object (readonly)
Returns the value of attribute third_rule.
5 6 7 |
# File 'lib/minitest/metz/scan_results.rb', line 5 def third_rule @third_rule end |
Instance Method Details
#all_valid? ⇒ Boolean
14 15 16 |
# File 'lib/minitest/metz/scan_results.rb', line 14 def all_valid? first_rule_valid? && misidentation_valid? && second_rule_valid? && third_rule_valid? end |
#first_rule_valid? ⇒ Boolean
18 19 20 |
# File 'lib/minitest/metz/scan_results.rb', line 18 def first_rule_valid? first_rule.zero? end |
#misidentation_valid? ⇒ Boolean
22 23 24 |
# File 'lib/minitest/metz/scan_results.rb', line 22 def misidentation_valid? misindentation.zero? end |
#second_rule_valid? ⇒ Boolean
26 27 28 |
# File 'lib/minitest/metz/scan_results.rb', line 26 def second_rule_valid? second_rule.zero? end |
#third_rule_valid? ⇒ Boolean
30 31 32 |
# File 'lib/minitest/metz/scan_results.rb', line 30 def third_rule_valid? third_rule.zero? end |