Class: Kennel::Syncer::PlanDisplayer

Inherits:
Object
  • Object
show all
Defined in:
lib/kennel/syncer/plan_displayer.rb

Instance Method Summary collapse

Constructor Details

#initializePlanDisplayer

Returns a new instance of PlanDisplayer.



6
7
8
# File 'lib/kennel/syncer/plan_displayer.rb', line 6

def initialize
  @attribute_differ = AttributeDiffer.new
end

Instance Method Details

#display(internal_plan) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/kennel/syncer/plan_displayer.rb', line 10

def display(internal_plan)
  Kennel.out.puts "Plan:"
  if internal_plan.empty?
    Kennel.out.puts Console.color(:green, "Nothing to do")
  else
    print_changes "Create", internal_plan.creates, :green
    print_changes "Update", internal_plan.updates, :yellow
    print_changes "Delete", internal_plan.deletes, :red
  end
end