Class: Snaptoken::Diff::HTMLLineByLine

Inherits:
Rouge::Formatter
  • Object
show all
Defined in:
lib/snaptoken/diff.rb

Instance Method Summary collapse

Constructor Details

#initialize(formatter) ⇒ HTMLLineByLine

Returns a new instance of HTMLLineByLine.



149
150
151
# File 'lib/snaptoken/diff.rb', line 149

def initialize(formatter)
  @formatter = formatter
end

Instance Method Details

#stream(tokens, &b) ⇒ Object



153
154
155
156
157
158
159
160
# File 'lib/snaptoken/diff.rb', line 153

def stream(tokens, &b)
  token_lines(tokens) do |line|
    line.each do |tok, val|
      yield @formatter.span(tok, val)
    end
    yield "\n"
  end
end