Class: ImageDiff::Differ::Differences

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Singleton
Defined in:
lib/image_diff/differ/differ.rb

Overview

Singleton to store differences

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(list = {}) ⇒ Differences

Returns a new instance of Differences.



36
37
38
# File 'lib/image_diff/differ/differ.rb', line 36

def initialize(list = {})
  @list = list
end

Class Method Details

.resultObject

TODO: output failures separately from reference file misses

also produce screenshot on failure


46
47
48
# File 'lib/image_diff/differ/differ.rb', line 46

def self.result
  instance.map { |diff| puts(*diff) }
end

Instance Method Details

#[]=(key, str) ⇒ Object



40
41
42
# File 'lib/image_diff/differ/differ.rb', line 40

def []=(key, str)
  @list[key] = str unless str.chomp.empty?
end