Class: Glossarist::ComparisonResult

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/glossarist/comparison_result.rb

Instance Method Summary collapse

Instance Method Details

#summaryObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/glossarist/comparison_result.rb', line 21

def summary
  diff = new_count - old_count
  change = if diff.positive?
             "+#{diff} new"
           elsif diff.negative?
             "#{diff.abs} removed"
           else
             "no change"
           end
  "#{new_count} new, #{old_count} old (#{change}), " \
    "#{matched.length} matched, #{new_only.length} new-only, " \
    "#{old_only.length} old-only"
end