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.



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