Class: Far::ChangeReport
Instance Attribute Summary collapse
-
#report ⇒ Object
Returns the value of attribute report.
Instance Method Summary collapse
-
#initialize(files) ⇒ ChangeReport
constructor
A new instance of ChangeReport.
- #print ⇒ Object
Methods inherited from Hash
Constructor Details
#initialize(files) ⇒ ChangeReport
Returns a new instance of ChangeReport.
5 6 7 |
# File 'lib/far/change_report.rb', line 5 def initialize(files) files.each { |file| self[file.name] = file.changes } end |
Instance Attribute Details
#report ⇒ Object
Returns the value of attribute report.
3 4 5 |
# File 'lib/far/change_report.rb', line 3 def report @report end |
Instance Method Details
#print ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/far/change_report.rb', line 9 def print each do |file, changes| changes.each do |change| puts "\033[32m#{file}\033[0m #{change[:line_number]}:" puts change[:original] puts change[:changed] puts end end end |