class RuboCop::AST::StrNode

A node extension for `str`, `dstr`, and `xstr` nodes. This will be used in place of a plain node when the builder constructs the AST, making its methods available to all `str` nodes within RuboCop.

Public Instance Methods

character_literal?() click to toggle source
# File lib/rubocop/ast/node/str_node.rb, line 11
def character_literal?
  loc.respond_to?(:begin) && loc.begin && loc.begin.is?('?')
end
heredoc?() click to toggle source
# File lib/rubocop/ast/node/str_node.rb, line 15
def heredoc?
  loc.is_a?(Parser::Source::Map::Heredoc)
end