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.



24
25
26
# File 'lib/snaptoken/commands/doc.rb', line 24

def initialize(formatter)
  @formatter = formatter
end

Instance Method Details

#stream(tokens, &b) ⇒ Object



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

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