Class: Simulacrum::Diff

Inherits:
Object
  • Object
show all
Defined in:
lib/simulacrum/diff.rb

Overview

Base class for implementing diffing strategies

Direct Known Subclasses

RMagicDiff

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(a_path, b_path) ⇒ Diff

Returns a new instance of Diff.



7
8
9
10
11
12
# File 'lib/simulacrum/diff.rb', line 7

def initialize(a_path, b_path)
  @a_path = a_path
  @b_path = b_path

  compare
end

Instance Attribute Details

#a_pathObject

Returns the value of attribute a_path.



5
6
7
# File 'lib/simulacrum/diff.rb', line 5

def a_path
  @a_path
end

#b_pathObject

Returns the value of attribute b_path.



5
6
7
# File 'lib/simulacrum/diff.rb', line 5

def b_path
  @b_path
end

#deltaObject

Returns the value of attribute delta.



5
6
7
# File 'lib/simulacrum/diff.rb', line 5

def delta
  @delta
end

#imageObject

Returns the value of attribute image.



5
6
7
# File 'lib/simulacrum/diff.rb', line 5

def image
  @image
end

Instance Method Details

#save(path) ⇒ Object



14
15
16
# File 'lib/simulacrum/diff.rb', line 14

def save(path)
  @image.write(path)
end