class Prism::StringQuery
Query methods that allow categorizing strings based on their context for where they could be valid in a Ruby syntax tree.
Attributes
The string that this query is wrapping.
Public Class Methods
Source
# File lib/prism/string_query.rb, line 12 def initialize(string) @string = string end
Initialize a new query with the given string.
Public Instance Methods
Source
# File lib/prism/string_query.rb, line 22 def constant? StringQuery.constant?(string) end
Whether or not this string is a valid constant name.
Source
# File lib/prism/string_query.rb, line 17 def local? StringQuery.local?(string) end
Whether or not this string is a valid local variable name.
Source
# File lib/prism/string_query.rb, line 27 def method_name? StringQuery.method_name?(string) end
Whether or not this string is a valid method name.