class ActionDispatch::Journey::Path::Pattern::AnchoredRegexp
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/action_dispatch/journey/path/pattern.rbs class ActionDispatch::Journey::Path::Pattern::AnchoredRegexp < ActionDispatch::Journey::Path::Pattern::Journey::Visitors::Visitor def accept: ((ActionDispatch::Journey::Nodes::Cat | ActionDispatch::Journey::Nodes::Slash) node) -> Regexp def initialize: (String separator, Hash matchers) -> void def visit_CAT: (ActionDispatch::Journey::Nodes::Cat node) -> String def visit_GROUP: (ActionDispatch::Journey::Nodes::Group node) -> String def visit_LITERAL: ((ActionDispatch::Journey::Nodes::Literal | ActionDispatch::Journey::Nodes::Dot) node) -> String def visit_SLASH: (ActionDispatch::Journey::Nodes::Slash node) -> String def visit_SYMBOL: (Symbol node) -> String end
:nodoc:
def accept(node)
Experimental RBS support (using type sampling data from the type_fusion
project).
def accept: ((ActionDispatch::Journey::Nodes::Cat | ActionDispatch::Journey::Nodes::Slash) node) -> Regexp
This signature was generated using 6 samples from 1 application.
def accept(node) %r{\A#{visit node}\Z} end
def initialize(separator, matchers)
Experimental RBS support (using type sampling data from the type_fusion
project).
def initialize: (String separator, (filename | Regexp | | version | Regexp) matchers) -> void
This signature was generated using 6 samples from 1 application.
def initialize(separator, matchers) @separator = separator @matchers = matchers @separator_re = "([^#{separator}]+)" super() end
def visit_CAT(node)
Experimental RBS support (using type sampling data from the type_fusion
project).
def visit_CAT: (ActionDispatch::Journey::Nodes::Cat node) -> String
This signature was generated using 60 samples from 2 applications.
def visit_CAT(node) "#{visit(node.left)}#{visit(node.right)}" end
def visit_GROUP(node)
Experimental RBS support (using type sampling data from the type_fusion
project).
def visit_GROUP: (ActionDispatch::Journey::Nodes::Group node) -> String
This signature was generated using 6 samples from 1 application.
def visit_GROUP(node) "(?:#{visit node.left})?" end
def visit_LITERAL(node)
Experimental RBS support (using type sampling data from the type_fusion
project).
def visit_LITERAL: ((ActionDispatch::Journey::Nodes::Literal | ActionDispatch::Journey::Nodes::Dot) node) -> String
This signature was generated using 22 samples from 1 application.
def visit_LITERAL(node) Regexp.escape(node.left) end
def visit_OR(node)
def visit_OR(node) children = node.children.map { |n| visit n } "(?:#{children.join(?|)})" end
def visit_SLASH(node)
Experimental RBS support (using type sampling data from the type_fusion
project).
def visit_SLASH: (ActionDispatch::Journey::Nodes::Slash node) -> String
This signature was generated using 25 samples from 1 application.
def visit_SLASH(node) node.left end
def visit_STAR(node)
def visit_STAR(node) re = @matchers[node.left.to_sym] re ? "(#{re})" : "(.+)" end
def visit_SYMBOL(node)
Experimental RBS support (using type sampling data from the type_fusion
project).
def visit_SYMBOL: (Symbol node) -> String
This signature was generated using 8 samples from 1 application.
def visit_SYMBOL(node) node = node.to_sym return @separator_re unless @matchers.key?(node) re = @matchers[node] "(#{Regexp.union(re)})" end