Module: Gorillib::DiffDrawerMethods

Included in:
DiffDrawer
Defined in:
lib/gorillib/diff.rb

Instance Method Summary collapse

Instance Method Details

#display_add_items(diff_subset) ⇒ Object


117
118
119
120
121
122
# File 'lib/gorillib/diff.rb', line 117

def display_add_items diff_subset
  return if diff_subset.nil?
  diff_subset.each do |cchange|
    display_add(cchange.old_element, cchange.new_element)
  end
end

#display_diff_indices(diff_subset) ⇒ Object



96
97
98
99
100
101
# File 'lib/gorillib/diff.rb', line 96

def display_diff_indices diff_subset
  return if diff_subset.nil? or diff_subset.empty?
  diff_subset.first.tap do |cchange|
    display_indices(cchange.old_position, cchange.new_position)
  end
end

#display_eql_items(diff_subset) ⇒ Object


103
104
105
106
107
108
# File 'lib/gorillib/diff.rb', line 103

def display_eql_items diff_subset
  return if diff_subset.nil?
  diff_subset.each do |cchange|
    display_eql(cchange.old_element)
  end
end

#display_noteql_items(diff_subset) ⇒ Object


110
111
112
113
114
115
# File 'lib/gorillib/diff.rb', line 110

def display_noteql_items diff_subset
  return if diff_subset.nil?
  diff_subset.each do |cchange|
    display_noteql_atoms(cchange.old_element, cchange.new_element)
  end
end

#for_subhash(key) ⇒ Object


87
88
89
90
91
92
# File 'lib/gorillib/diff.rb', line 87

def for_subhash(key)
  display_key_header(key)
  increase_indentation
  yield
  decrease_indentation
end