Class: DatarocketsStyle::Formatter::TodoListFormatter::ReportSummary::OffenseGroup
- Inherits:
-
Struct
- Object
- Struct
- DatarocketsStyle::Formatter::TodoListFormatter::ReportSummary::OffenseGroup
- Defined in:
- lib/datarockets_style/formatter/todo_list_formatter/report_summary.rb
Instance Attribute Summary collapse
-
#cop_name ⇒ Object
Returns the value of attribute cop_name.
-
#offenses ⇒ Object
Returns the value of attribute offenses.
Instance Method Summary collapse
Instance Attribute Details
#cop_name ⇒ Object
Returns the value of attribute cop_name
23 24 25 |
# File 'lib/datarockets_style/formatter/todo_list_formatter/report_summary.rb', line 23 def cop_name @cop_name end |
#offenses ⇒ Object
Returns the value of attribute offenses
23 24 25 |
# File 'lib/datarockets_style/formatter/todo_list_formatter/report_summary.rb', line 23 def offenses @offenses end |
Instance Method Details
#file_groups ⇒ Object
24 25 26 27 28 |
# File 'lib/datarockets_style/formatter/todo_list_formatter/report_summary.rb', line 24 def file_groups @_file_groups ||= offenses.group_by(&:file_path).map do |file, offenses| FileGroup.new(file, offenses.length) end end |
#print(output) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/datarockets_style/formatter/todo_list_formatter/report_summary.rb', line 30 def print(output) output.puts("#{cop_name}:") output.puts(" Exclude:") file_groups.sort_by(&:file).each do |file_group| file_group.print(output) end output.puts end |