Class: Kennel::Syncer::PlanPrinter
- Inherits:
-
Object
- Object
- Kennel::Syncer::PlanPrinter
- Defined in:
- lib/kennel/syncer/plan_printer.rb
Instance Method Summary collapse
-
#initialize ⇒ PlanPrinter
constructor
A new instance of PlanPrinter.
- #print(plan) ⇒ Object
Constructor Details
#initialize ⇒ PlanPrinter
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
#print(plan) ⇒ Object
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 |