class CodeRay::Encoders::Filter
A Filter
encoder has another Tokens
instance as output. It can be subclass to select, remove, or modify tokens in the stream.
Subclasses of Filter
are called “Filters” and can be chained.
Options¶ ↑
:tokens¶ ↑
The Tokens
object which will receive the output.
Default: Tokens.new
See also: TokenKindFilter
Protected Instance Methods
Source
# File lib/coderay/encoders/filter.rb, line 29 def finish options output @tokens end
Source
# File lib/coderay/encoders/filter.rb, line 23 def setup options super @tokens = options[:tokens] || Tokens.new end
Calls superclass method
CodeRay::Encoders::Encoder#setup