Class: DomGlancy::Analyzer

Inherits:
Object
  • Object
show all
Defined in:
lib/dom_glancy/analyzer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(master_data, current_data, test_root = nil) ⇒ Analyzer

Returns a new instance of Analyzer.



12
13
14
15
16
# File 'lib/dom_glancy/analyzer.rb', line 12

def initialize(master_data, current_data, test_root = nil)
  @master_data  = master_data
  @current_data = current_data
  @test_root    = test_root
end

Instance Attribute Details

#changed_element_pairsObject (readonly)

Returns the value of attribute changed_element_pairs.



6
7
8
# File 'lib/dom_glancy/analyzer.rb', line 6

def changed_element_pairs
  @changed_element_pairs
end

#set_changed_masterObject (readonly)

Returns the value of attribute set_changed_master.



5
6
7
# File 'lib/dom_glancy/analyzer.rb', line 5

def set_changed_master
  @set_changed_master
end

#set_current_not_masterObject (readonly)

Returns the value of attribute set_current_not_master.



3
4
5
# File 'lib/dom_glancy/analyzer.rb', line 3

def set_current_not_master
  @set_current_not_master
end

#set_master_not_currentObject (readonly)

Returns the value of attribute set_master_not_current.



4
5
6
# File 'lib/dom_glancy/analyzer.rb', line 4

def set_master_not_current
  @set_master_not_current
end

Instance Method Details

#analyzeObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/dom_glancy/analyzer.rb', line 18

def analyze
  clear_results

  if missing_elements? || extra_elements?
    remove_similar_elements
    extract_changed_elements
  end

  # create_diff_file if @test_root && !all_same?
  compile_results
end