Class: CartoCSSHelper::ImageForComparison

Inherits:
Object
  • Object
show all
Defined in:
lib/cartocss_helper/visualise_changes_diff_from_images.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_location, description) ⇒ ImageForComparison

Returns a new instance of ImageForComparison.



8
9
10
11
# File 'lib/cartocss_helper/visualise_changes_diff_from_images.rb', line 8

def initialize(file_location, description)
  @file_location = file_location
  @description = description
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



7
8
9
# File 'lib/cartocss_helper/visualise_changes_diff_from_images.rb', line 7

def description
  @description
end

#file_locationObject (readonly)

Returns the value of attribute file_location.



7
8
9
# File 'lib/cartocss_helper/visualise_changes_diff_from_images.rb', line 7

def file_location
  @file_location
end

Instance Method Details

#identical(another_image) ⇒ Object



13
14
15
16
# File 'lib/cartocss_helper/visualise_changes_diff_from_images.rb', line 13

def identical(another_image)
  # Returns true if the contents of a file A and a file B are identical.
  return FileUtils.compare_file(file_location, another_image.file_location)
end