Class: Inch::CLI::Command::Output::Diff

Inherits:
Base
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/inch/cli/command/output/diff.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#print_file_info, #priority_arrow

Methods included from TraceHelper

#ui

Constructor Details

#initialize(options, comparer) ⇒ Diff

Returns a new instance of Diff.

Parameters:



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/inch/cli/command/output/diff.rb', line 12

def initialize(options, comparer)
  @options = options
  @comparer = comparer

  added    = @comparer.added_objects
  improved = @comparer.improved_objects
  degraded = @comparer.degraded_objects

  if added.empty? && improved.empty? && degraded.empty?
    ui.trace "No changes."
  else
    show(added, improved, degraded)
  end
end

Instance Attribute Details

#comparerObject (readonly)

Returns the value of attribute comparer.



8
9
10
# File 'lib/inch/cli/command/output/diff.rb', line 8

def comparer
  @comparer
end