Class: GitAwesomeDiff::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/git_awesome_diff/formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(added_objects, removed_objects) ⇒ Formatter

Returns a new instance of Formatter.



3
4
5
6
# File 'lib/git_awesome_diff/formatter.rb', line 3

def initialize(added_objects, removed_objects)
  @added = added_objects
  @removed = removed_objects
end

Instance Method Details



8
9
10
11
12
13
14
# File 'lib/git_awesome_diff/formatter.rb', line 8

def print(format, *args)
  puts "Showing diff between #{args[0]} and #{args[1]}\n".colorize(:black)
  case format
  when /pretty/ then pretty_print
  when /simple/ then simple_print
  end
end