lib/rubocop/ast/node/str_node.rb in rubocop-ast-1.22.0 vs lib/rubocop/ast/node/str_node.rb in rubocop-ast-1.23.0
- old
+ new
@@ -6,9 +6,13 @@
# in place of a plain node when the builder constructs the AST, making
# its methods available to all `str` nodes within RuboCop.
class StrNode < Node
include BasicLiteralNode
+ def character_literal?
+ loc.respond_to?(:begin) && loc.begin && loc.begin.is?('?')
+ end
+
def heredoc?
loc.is_a?(Parser::Source::Map::Heredoc)
end
end
end