class Grape::Router::BaseRoute

Attributes

attributes[R]
index[R]
options[R]
pattern[R]

Public Class Methods

new(**options) click to toggle source
# File lib/grape/router/base_route.rb, line 10
def initialize(**options)
  @options = ActiveSupport::OrderedOptions.new.update(options)
end

Public Instance Methods

pattern_regexp() click to toggle source
# File lib/grape/router/base_route.rb, line 20
def pattern_regexp
  pattern.to_regexp
end
regexp_capture_index() click to toggle source
# File lib/grape/router/base_route.rb, line 16
def regexp_capture_index
  CaptureIndexCache[index]
end
to_regexp(index) click to toggle source
# File lib/grape/router/base_route.rb, line 24
def to_regexp(index)
  @index = index
  Regexp.new("(?<#{regexp_capture_index}>#{pattern_regexp})")
end