Class: GitAwesomeDiff::Formatter
- Inherits:
-
Object
- Object
- GitAwesomeDiff::Formatter
- Defined in:
- lib/git_awesome_diff/formatter.rb
Instance Method Summary collapse
-
#initialize(added_objects, removed_objects) ⇒ Formatter
constructor
A new instance of Formatter.
- #print(format, *args) ⇒ Object
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
#print(format, *args) ⇒ Object
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 |