Method: CodeRay::Encoders::Encoder#encode_stream
- Defined in:
- lib/coderay/encoder.rb
#encode_stream(code, lang, options = {}) ⇒ Object
Encode the given code using the Scanner for lang in streaming mode.
97 98 99 100 101 102 103 104 105 |
# File 'lib/coderay/encoder.rb', line 97 def encode_stream code, lang, = {} raise NotStreamableError, self unless kind_of? Streamable = @options.merge setup = CodeRay. @token_stream = CodeRay.scan_stream code, lang, , &self finish end |