class RuboCop::AST::RegexpNode
to all ‘regexp` nodes within RuboCop.
node when the builder constructs the AST, making its methods available
A node extension for `regexp` nodes. This will be used in place of a plain
def content
-
(String)
- a string of regexp content
def content str = children.first str.str_content || '' end
def regopt
-
(RuboCop::AST::Node)
- a regopt node
def regopt first, second = *self first.regopt_type? ? first : second end
def to_regexp
-
(Regexp)
- a regexp of this node
def to_regexp option = regopt.children.map { |opt| OPTIONS[opt] }.inject(:|) Regexp.new(content, option) end