class Google::Gax::PathParse

Parser for the path_template language

Attributes

binding_var_count[R]
segment_count[R]

Public Class Methods

new(*args) click to toggle source
Calls superclass method
# File lib/google/gax/path_template.rb, line 54
def initialize(*args)
  super
  @segment_count = 0
  @binding_var_count = 0
end

Public Instance Methods

parse(*args) click to toggle source
Calls superclass method
# File lib/google/gax/path_template.rb, line 60
def parse(*args)
  segments = super
  has_path_wildcard = false
  raise 'path template has no segments' if segments.nil?
  segments.each do |s|
    next unless s.kind == TERMINAL && s.literal == '**'
    if has_path_wildcard
      raise 'path template cannot contain more than one path wildcard'
    end
    has_path_wildcard = true
  end
  segments
end