Sha256: 42511e394361dc9ff62db983f93648a1fbacf8cbfebe5e189fd36fd2abcf6dc4

Contents?: true

Size: 1.04 KB

Versions: 6968

Compression:

Stored size: 1.04 KB

Contents

module CodeRay
module Encoders
  
  # 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
  class Filter < Encoder
    
    register_for :filter
    
  protected
    def setup options
      super
      
      @tokens = options[:tokens] || Tokens.new
    end
    
    def finish options
      output @tokens
    end
    
  public
    
    def text_token text, kind  # :nodoc:
      @tokens.text_token text, kind
    end
    
    def begin_group kind  # :nodoc:
      @tokens.begin_group kind
    end
    
    def begin_line kind  # :nodoc:
      @tokens.begin_line kind
    end
    
    def end_group kind  # :nodoc:
      @tokens.end_group kind
    end
    
    def end_line kind  # :nodoc:
      @tokens.end_line kind
    end
    
  end
  
end
end

Version data entries

6,968 entries across 6,956 versions & 74 rubygems

Version Path
cybrid_api_organization_ruby-0.123.152 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_bank_ruby-0.123.151 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_id_ruby-0.123.151 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_organization_ruby-0.123.151 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_bank_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_id_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_organization_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_bank_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_id_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_organization_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_bank_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_organization_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_id_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
ory-client-1.16.2 vendor/bundle/ruby/3.1.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_bank_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_organization_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_id_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_bank_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb
cybrid_api_id_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib/coderay/encoders/filter.rb