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

Returns:
  • (String) - a string of regexp content
def content
  str = children.first
  str.str_content || ''
end

def regopt

Returns:
  • (RuboCop::AST::Node) - a regopt node
def regopt
  first, second = *self
  first.regopt_type? ? first : second
end

def to_regexp

Returns:
  • (Regexp) - a regexp of this node
def to_regexp
  option = regopt.children.map { |opt| OPTIONS[opt] }.inject(:|)
  Regexp.new(content, option)
end