gapic-generator/lib/gapic/path_pattern/segment.rb
##
# Creates a string with a regex representation of this segment's pattern
# @return [String]
Creates a string with a regex representation of this segment's pattern
Creates a string with a regex representation of this segment ' s pattern
def to_regex_str
        raise "Not implemented for multivariate ResourceId segments" if resource_patterns.count > 1
        resource_pattern = if resource_patterns[0].nil?
                             "*"
                           else
                             resource_patterns[0]
                           end
        resource_pattern_regex = Gapic::PathPattern::Parser.parse(resource_pattern).to_regex_str
        "(?<#{resource_names[0]}>#{resource_pattern_regex})"
      end
def to_regex_str raise "Not implemented for multivariate ResourceId segments" if resource_patterns . count > 1 resource_pattern = if resource_patterns [ 0 ] . nil? "*" else resource_patterns [ 0 ] end resource_pattern_regex = Gapic :: PathPattern :: Parser . parse ( resource_pattern ) . to_regex_str "(?<#{resource_names[0]}>#{resource_pattern_regex})" end
Creates a string with a regex representation of this segment's pattern
Creates a string with a regex representation of this segment ' s pattern
None
String