Class: Txgh::DiffCalculator

Inherits:
Object
  • Object
show all
Defined in:
lib/txgh/diff_calculator.rb

Constant Summary collapse

INCLUDED_STATES =
[:added, :modified, :removed]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(head_phrases, diff_point_phrases) ⇒ DiffCalculator

Returns a new instance of DiffCalculator.



13
14
15
16
# File 'lib/txgh/diff_calculator.rb', line 13

def initialize(head_phrases, diff_point_phrases)
  @head_phrases = head_phrases
  @diff_point_phrases = diff_point_phrases
end

Instance Attribute Details

#diff_point_phrasesObject (readonly)

Returns the value of attribute diff_point_phrases.



11
12
13
# File 'lib/txgh/diff_calculator.rb', line 11

def diff_point_phrases
  @diff_point_phrases
end

#head_phrasesObject (readonly)

Returns the value of attribute head_phrases.



11
12
13
# File 'lib/txgh/diff_calculator.rb', line 11

def head_phrases
  @head_phrases
end

Class Method Details

.compare(head_phrases, diff_point_phrases) ⇒ Object



4
5
6
# File 'lib/txgh/diff_calculator.rb', line 4

def compare(head_phrases, diff_point_phrases)
  new(head_phrases, diff_point_phrases).compare
end

Instance Method Details

#compareObject



18
19
20
# File 'lib/txgh/diff_calculator.rb', line 18

def compare
  join_diffs(compare_head, compare_diff_point)
end