Class: ImageDiff::Differ::Results::List
- Inherits:
-
Object
- Object
- ImageDiff::Differ::Results::List
- Extended by:
- Forwardable
- Includes:
- Singleton
- Defined in:
- lib/image_diff/differ/results/list.rb
Overview
Results list
Instance Method Summary collapse
- #clear ⇒ Object
- #filter(method) ⇒ Object
-
#initialize ⇒ List
constructor
A new instance of List.
- #reference_errors ⇒ Object
- #regressions ⇒ Object
Constructor Details
#initialize ⇒ List
Returns a new instance of List.
15 16 17 |
# File 'lib/image_diff/differ/results/list.rb', line 15 def initialize clear end |
Instance Method Details
#clear ⇒ Object
19 20 21 |
# File 'lib/image_diff/differ/results/list.rb', line 19 def clear @list = Hash.new { |hash, key| hash[key] = [] } end |
#filter(method) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/image_diff/differ/results/list.rb', line 23 def filter(method) each_with_object({}) do |(component, results), hash| selected = Filter.apply(results, method) hash[component] = selected unless selected.empty? end end |
#reference_errors ⇒ Object
30 31 32 |
# File 'lib/image_diff/differ/results/list.rb', line 30 def reference_errors filter(:select) end |
#regressions ⇒ Object
34 35 36 |
# File 'lib/image_diff/differ/results/list.rb', line 34 def regressions filter(:reject) end |