class RuboCop::MagicComment::EmacsComment

Wrapper for Emacs style magic comments.

@example Emacs style comment

comment = RuboCop::MagicComment.parse(
  '# -*- encoding: ASCII-8BIT -*-'
)

comment.encoding # => 'ascii-8bit'

@see www.gnu.org/software/emacs/manual/html_node/emacs/Specify-Coding.html @see git.io/vMCXh Emacs handling in Ruby's parse.y

Constants

FORMAT
OPERATOR
SEPARATOR

Public Instance Methods

encoding() click to toggle source
# File lib/rubocop/magic_comment.rb, line 136
def encoding
  match('encoding')
end

Private Instance Methods

extract_frozen_string_literal() click to toggle source
# File lib/rubocop/magic_comment.rb, line 142
def extract_frozen_string_literal
  match('frozen_string_literal')
end