Class: Diff::Renderer::Base
- Inherits:
-
Object
- Object
- Diff::Renderer::Base
- Defined in:
- lib/diff/renderer/base.rb
Direct Known Subclasses
Instance Method Summary collapse
- #addline(line) ⇒ Object
- #after_addblock(block) ⇒ Object
- #after_headerblock(block) ⇒ Object
- #after_modblock(block) ⇒ Object
- #after_nonewlineblock(block) ⇒ Object
- #after_remblock(block) ⇒ Object
- #after_sepblock(block) ⇒ Object
- #after_unmodblock(block) ⇒ Object
- #before_addblock(block) ⇒ Object
- #before_headerblock(block) ⇒ Object
- #before_modblock(block) ⇒ Object
- #before_nonewlineblock(block) ⇒ Object
- #before_remblock(block) ⇒ Object
- #before_sepblock(block) ⇒ Object
- #before_unmodblock(block) ⇒ Object
- #headerline(line) ⇒ Object
- #new_line ⇒ Object
- #nonewlineline(line) ⇒ Object
- #remline(line) ⇒ Object
- #render(data) ⇒ Object
- #sepline(line) ⇒ Object
- #unmodline(line) ⇒ Object
Instance Method Details
#addline(line) ⇒ Object
47 48 49 |
# File 'lib/diff/renderer/base.rb', line 47 def addline(line) line end |
#after_addblock(block) ⇒ Object
71 72 |
# File 'lib/diff/renderer/base.rb', line 71 def after_addblock(block) end |
#after_headerblock(block) ⇒ Object
59 60 |
# File 'lib/diff/renderer/base.rb', line 59 def after_headerblock(block) end |
#after_modblock(block) ⇒ Object
65 66 |
# File 'lib/diff/renderer/base.rb', line 65 def after_modblock(block) end |
#after_nonewlineblock(block) ⇒ Object
77 78 |
# File 'lib/diff/renderer/base.rb', line 77 def after_nonewlineblock(block) end |
#after_remblock(block) ⇒ Object
68 69 |
# File 'lib/diff/renderer/base.rb', line 68 def after_remblock(block) end |
#after_sepblock(block) ⇒ Object
74 75 |
# File 'lib/diff/renderer/base.rb', line 74 def after_sepblock(block) end |
#after_unmodblock(block) ⇒ Object
62 63 |
# File 'lib/diff/renderer/base.rb', line 62 def after_unmodblock(block) end |
#before_addblock(block) ⇒ Object
26 27 |
# File 'lib/diff/renderer/base.rb', line 26 def before_addblock(block) end |
#before_headerblock(block) ⇒ Object
14 15 |
# File 'lib/diff/renderer/base.rb', line 14 def before_headerblock(block) end |
#before_modblock(block) ⇒ Object
20 21 |
# File 'lib/diff/renderer/base.rb', line 20 def before_modblock(block) end |
#before_nonewlineblock(block) ⇒ Object
32 33 |
# File 'lib/diff/renderer/base.rb', line 32 def before_nonewlineblock(block) end |
#before_remblock(block) ⇒ Object
23 24 |
# File 'lib/diff/renderer/base.rb', line 23 def before_remblock(block) end |
#before_sepblock(block) ⇒ Object
29 30 |
# File 'lib/diff/renderer/base.rb', line 29 def before_sepblock(block) end |
#before_unmodblock(block) ⇒ Object
17 18 |
# File 'lib/diff/renderer/base.rb', line 17 def before_unmodblock(block) end |
#headerline(line) ⇒ Object
35 36 37 |
# File 'lib/diff/renderer/base.rb', line 35 def headerline(line) line end |
#new_line ⇒ Object
80 81 82 |
# File 'lib/diff/renderer/base.rb', line 80 def new_line "" end |
#nonewlineline(line) ⇒ Object
55 56 57 |
# File 'lib/diff/renderer/base.rb', line 55 def nonewlineline(line) line end |
#remline(line) ⇒ Object
43 44 45 |
# File 'lib/diff/renderer/base.rb', line 43 def remline(line) line end |
#render(data) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/diff/renderer/base.rb', line 4 def render(data) result = [] data.each do |block| result << send("before_" + classify(block), block) result << block.map { |line| send(classify(line), line) } result << send("after_" + classify(block), block) end result.compact.join(new_line) end |
#sepline(line) ⇒ Object
51 52 53 |
# File 'lib/diff/renderer/base.rb', line 51 def sepline(line) end |
#unmodline(line) ⇒ Object
39 40 41 |
# File 'lib/diff/renderer/base.rb', line 39 def unmodline(line) line end |