Class: CodeRay::Encoders::CommentFilter

Inherits:
TokenKindFilter show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/coderay-1.1.3/lib/coderay/encoders/comment_filter.rb

Overview

A simple Filter that removes all tokens of the :comment kind.

Alias: remove_comments

Usage:

CodeRay.scan('print # foo', :ruby).comment_filter.text
#-> "print "

See also: TokenKindFilter, LinesOfCode

Constant Summary collapse

DEFAULT_OPTIONS =
superclass::DEFAULT_OPTIONS.merge \
:exclude => [:comment, :docstring]

Instance Attribute Summary

Attributes inherited from Encoder

#options, #scanner

Attributes included from Plugin

#plugin_id

Method Summary

Methods inherited from TokenKindFilter

#begin_group, #begin_line, #end_group, #end_line, #text_token

Methods inherited from Filter

#begin_group, #begin_line, #end_group, #end_line, #text_token

Methods inherited from Encoder

#<<, #begin_group, #begin_line, const_missing, #encode, #encode_tokens, #end_group, #end_line, #file_extension, file_extension, #initialize, #text_token, #token

Methods included from Plugin

#aliases, #plugin_host, #register_for, #title

Constructor Details

This class inherits a constructor from CodeRay::Encoders::Encoder