Sha256: 42511e394361dc9ff62db983f93648a1fbacf8cbfebe5e189fd36fd2abcf6dc4

Contents?: true

Size: 1.04 KB

Versions: 6970

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,970 entries across 6,957 versions & 75 rubygems

Version Path
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/coderay-1.1.1/lib/coderay/encoders/filter.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/coderay-1.1.1/lib/coderay/encoders/filter.rb
gameboard-3.1.0 vendor/bundle/ruby/2.3.0/gems/coderay-1.1.1/lib/coderay/encoders/filter.rb
gameboard-3.0.0 vendor/bundle/ruby/2.3.0/gems/coderay-1.1.1/lib/coderay/encoders/filter.rb
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/coderay-1.1.1/lib/coderay/encoders/filter.rb
logstash-filter-delta-1.0.1 vendor/bundle/jruby/2.2.0/gems/coderay-1.1.1/lib/coderay/encoders/filter.rb
logstash-filter-base64-1.0.4 vendor/bundle/jruby/2.2.0/gems/coderay-1.1.1/lib/coderay/encoders/filter.rb
logstash-filter-base64-1.0.3 vendor/bundle/jruby/2.2.0/gems/coderay-1.1.1/lib/coderay/encoders/filter.rb
logstash-filter-delta-1.0.0 vendor/bundle/jruby/2.2.0/gems/coderay-1.1.1/lib/coderay/encoders/filter.rb
logstash-filter-base64-1.0.2 vendor/bundle/jruby/2.3.0/gems/coderay-1.1.1/lib/coderay/encoders/filter.rb
logstash-filter-base64-1.0.1 vendor/bundle/jruby/2.3.0/gems/coderay-1.1.1/lib/coderay/encoders/filter.rb
logstash-filter-base64-1.0.0 vendor/bundle/jruby/2.3.0/gems/coderay-1.1.1/lib/coderay/encoders/filter.rb
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/coderay-1.1.0/lib/coderay/encoders/filter.rb
coderay-1.1.1 lib/coderay/encoders/filter.rb
coderay-1.1.1.rc1 lib/coderay/encoders/filter.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/coderay-1.1.0/lib/coderay/encoders/filter.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/coderay-1.1.0/lib/coderay/encoders/filter.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/coderay-1.1.0/lib/coderay/encoders/filter.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/coderay-1.1.0/lib/coderay/encoders/filter.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/coderay-1.1.0/lib/coderay/encoders/filter.rb