class ActionDispatch::Journey::GTG::Builder
def nullable?(node)
Experimental RBS support (using type sampling data from the type_fusion
project).
type ActionDispatch__Journey__GTG__Builder_nullable?_node = ActionDispatch::Journey::Nodes::Literal | ActionDispatch::Journey::Nodes::Slash | ActionDispatch::Journey::Nodes::Symbol | ActionDispatch::Journey::Nodes::Dummy | ActionDispatch::Journey::Nodes::Dot | ActionDispatch::Journey::Nodes::Cat | ActionDispatch::Journey::Nodes::Group | ActionDispatch::Journey::Nodes::Star def nullable?: (ActionDispatch__Journey__GTG__Builder_nullable?_node node) -> bool
This signature was generated using 433 samples from 3 applications.
def nullable?(node) case node when Nodes::Group true when Nodes::Star # the default star regex is /(.+)/ which is NOT nullable # but since different constraints can be provided we must # actually check if this is the case or not. node.regexp.match?("") when Nodes::Or node.children.any? { |c| nullable?(c) } when Nodes::Cat nullable?(node.left) && nullable?(node.right) when Nodes::Terminal !node.left when Nodes::Unary nullable?(node.left) else raise ArgumentError, "unknown nullable: %s" % node.class.name end end