lib/apia/route_set.rb
# Find routes that exactly match a given path
#
# @param request_method [Symbol]
# @param path [String]
# @return [Array<Moonstone::Route>]
Find routes that exactly match a given path
Find routes that exactly match a given path
def find(request_method, path)
      parts = self.class.split_path(path)
      last = @map
      parts.size.times do |i|
        last = last[parts[i]] || last['?']
        return [] if last.nil?
      end
      last[:_routes].select { |r| r.request_method == request_method }
    end
def find ( request_method , path ) parts = self . class . split_path ( path ) last = @map parts . size . times do | i | last = last [ parts [ i ] ] || last [ '?' ] return [ ] if last . nil? end last [ :_routes ] . select { | r | r . request_method == request_method } end
Find routes that exactly match a given path
Find routes that exactly match a given path
None
Array<Moonstone::Route>
request_method
<not_specific>
path
<not_specific>
<not_specific>
None