Class: RuboCop::MagicComment::EditorComment Abstract
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
|
|
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
::RuboCop::MagicComment
|
|
|
Instance Chain:
self,
::RuboCop::MagicComment
|
|
| Inherits: |
RuboCop::MagicComment
|
| Defined in: | lib/rubocop/magic_comment.rb |
Overview
Parent to Vim and Emacs magic comment handling.
Constant Summary
::RuboCop::MagicComment - Inherited
Class Method Summary
::RuboCop::MagicComment - Inherited
Instance Attribute Summary
::RuboCop::MagicComment - Inherited
| #any?, #encoding_specified?, | |
| #frozen_string_literal? | Does the magic comment enable the frozen string literal feature. |
| #frozen_string_literal_specified? | Was a magic comment for the frozen string literal found? |
| #shareable_constant_value_specified? | Was a shareable_constant_value specified? |
| #typed_specified? | Was the Sorbet #typed sigil specified? |
| #valid?, #valid_literal_value?, #valid_shareable_constant_value? | |
Instance Method Summary
- #encoding
-
#without(type)
Rewrite the comment without a given token type.
-
#match(keyword) ⇒ String?
private
Find a token starting with the provided keyword and extract its value.
-
#tokens ⇒ Array<String>
private
Individual tokens composing an editor specific comment string.
::RuboCop::MagicComment - Inherited
| #frozen_string_literal | Expose the #frozen_string_literal value coerced to a boolean if possible. |
| #shareable_constant_value | Expose the #shareable_constant_value value coerced to a boolean if possible. |
| #typed, | |
| #extract | Match the entire comment string with a pattern and take the first capture. |
| #specified? | |
Constructor Details
This class inherits a constructor from RuboCop::MagicComment
Instance Method Details
#encoding
[ GitHub ]#match(keyword) ⇒ String? (private)
Find a token starting with the provided keyword and extract its value.
#tokens ⇒ Array<String> (private)
Individual tokens composing an editor specific comment string.
# File 'lib/rubocop/magic_comment.rb', line 174
def tokens extract(self.class::REGEXP).split(self.class::SEPARATOR).map(&:strip) end
#without(type)
Rewrite the comment without a given token type