Class: Snaptoken::Commands::Doc::HTMLLineByLine
- Inherits:
-
Rouge::Formatter
- Object
- Rouge::Formatter
- Snaptoken::Commands::Doc::HTMLLineByLine
- Defined in:
- lib/snaptoken/commands/doc.rb
Instance Method Summary collapse
-
#initialize(formatter) ⇒ HTMLLineByLine
constructor
A new instance of HTMLLineByLine.
- #stream(tokens, &b) ⇒ Object
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 |