Class: Pippi::Report
- Inherits:
-
Object
- Object
- Pippi::Report
- Defined in:
- lib/pippi/report.rb
Instance Attribute Summary collapse
-
#problems ⇒ Object
readonly
Returns the value of attribute problems.
-
#removed ⇒ Object
readonly
Returns the value of attribute removed.
Instance Method Summary collapse
- #add(problem) ⇒ Object
-
#initialize ⇒ Report
constructor
A new instance of Report.
- #remove(lineno, path, clazz) ⇒ Object
Constructor Details
#initialize ⇒ Report
Returns a new instance of Report.
7 8 9 10 |
# File 'lib/pippi/report.rb', line 7 def initialize @problems = [] @removed = Set.new end |
Instance Attribute Details
#problems ⇒ Object (readonly)
Returns the value of attribute problems.
5 6 7 |
# File 'lib/pippi/report.rb', line 5 def problems @problems end |
#removed ⇒ Object (readonly)
Returns the value of attribute removed.
5 6 7 |
# File 'lib/pippi/report.rb', line 5 def removed @removed end |
Instance Method Details
#add(problem) ⇒ Object
12 13 14 |
# File 'lib/pippi/report.rb', line 12 def add(problem) @problems << problem unless duplicate_report?(problem) || already_removed?(problem) end |
#remove(lineno, path, clazz) ⇒ Object
16 17 18 19 |
# File 'lib/pippi/report.rb', line 16 def remove(lineno, path, clazz) @removed << Pippi::Problem.new(:line_number => lineno, :file_path => path, :check_class => clazz).to_s @problems.reject! { |p| p.line_number == lineno && p.file_path == path && p.check_class == clazz } end |