Class: HashDiff::Comparison

Inherits:
Struct
  • Object
show all
Defined in:
lib/hash_diff/comparison.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#leftObject

Returns the value of attribute left

Returns:

  • (Object)

    the current value of left



4
5
6
# File 'lib/hash_diff/comparison.rb', line 4

def left
  @left
end

#rightObject

Returns the value of attribute right

Returns:

  • (Object)

    the current value of right



4
5
6
# File 'lib/hash_diff/comparison.rb', line 4

def right
  @right
end

Instance Method Details

#diffObject



6
7
8
9
# File 'lib/hash_diff/comparison.rb', line 6

def diff
  @side ||= :both
  @diff ||= differences(left, right)
end

#left_diffObject



11
12
13
14
# File 'lib/hash_diff/comparison.rb', line 11

def left_diff
  @side = :left
  @left_diff ||= differences(left, right)
end

#right_diffObject



16
17
18
19
# File 'lib/hash_diff/comparison.rb', line 16

def right_diff
  @side = :right
  @right_diff ||= differences(left, right)
end