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

finish(options) click to toggle source
# File lib/coderay/encoders/filter.rb, line 29
def finish options
  output @tokens
end
setup(options) click to toggle source
# File lib/coderay/encoders/filter.rb, line 23
def setup options
  super
  
  @tokens = options[:tokens] || Tokens.new
end