Class CodeRay::Encoders::Filter
In: lib/coderay/encoders/filter.rb
Parent: Encoder

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

Methods

finish   setup  

Protected Instance methods

[Source]

    # File lib/coderay/encoders/filter.rb, line 29
29:     def finish options
30:       output @tokens
31:     end

[Source]

    # File lib/coderay/encoders/filter.rb, line 23
23:     def setup options
24:       super
25:       
26:       @tokens = options[:tokens] || Tokens.new
27:     end

[Validate]