Class: Kennel::Syncer::PlanPrinter

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

Instance Method Summary collapse

Constructor Details

#initializePlanPrinter

Returns a new instance of PlanPrinter.



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

def initialize
  @attribute_differ = AttributeDiffer.new
end

Instance Method Details



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

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