Class: Snaptoken::Commands::Doc::HTMLLineByLine

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

Instance Method Summary collapse

Constructor Details

#initialize(formatter) ⇒ HTMLLineByLine

Returns a new instance of HTMLLineByLine.



26
27
28
# File 'lib/snaptoken/commands/doc.rb', line 26

def initialize(formatter)
  @formatter = formatter
end

Instance Method Details

#stream(tokens, &b) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/snaptoken/commands/doc.rb', line 30

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