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.



138
139
140
# File 'lib/snaptoken/diff.rb', line 138

def initialize(formatter)
  @formatter = formatter
end

Instance Method Details

#stream(tokens, &b) ⇒ Object



142
143
144
145
146
147
148
149
# File 'lib/snaptoken/diff.rb', line 142

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