Class: ConsulWatcher::Diff

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

Instance Method Summary collapse

Constructor Details

#initialize(parser_config) ⇒ Diff

Returns a new instance of Diff.



8
# File 'lib/consul_watcher/diff.rb', line 8

def initialize(parser_config) end

Instance Method Details

#parse(previous_watch_data, current_watch_data) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/consul_watcher/diff.rb', line 10

def parse(previous_watch_data, current_watch_data)
  diff = HashDiff.diff(sanitize_data(previous_watch_data), sanitize_data(current_watch_data), array_path: true)
  diff.each do |change|
    puts "change: #{change}"
    change[1] = change[1]&.join('/')
  end
  puts "hashdiff: #{diff}"
  diff
end