Class: Snaptoken::Diff::HTMLLineByLine
- Inherits:
-
Rouge::Formatter
- Object
- Rouge::Formatter
- Snaptoken::Diff::HTMLLineByLine
- Defined in:
- lib/snaptoken/diff.rb
Instance Method Summary collapse
-
#initialize(formatter) ⇒ HTMLLineByLine
constructor
A new instance of HTMLLineByLine.
- #stream(tokens, &b) ⇒ Object
Constructor Details
#initialize(formatter) ⇒ HTMLLineByLine
Returns a new instance of HTMLLineByLine.
135 136 137 |
# File 'lib/snaptoken/diff.rb', line 135 def initialize(formatter) @formatter = formatter end |
Instance Method Details
#stream(tokens, &b) ⇒ Object
139 140 141 142 143 144 145 146 |
# File 'lib/snaptoken/diff.rb', line 139 def stream(tokens, &b) token_lines(tokens) do |line| line.each do |tok, val| yield @formatter.span(tok, val) end yield "\n" end end |