lib/apia/route.rb
# Extract arguments from the given path and return a hash of the arguments
# based on their naming from the route
#
# @param given_path [String]
# @return [Hash]
Extract arguments from the given path and return a hash of the arguments
based on their naming from the route
Extract arguments from the given path and return a hash of the arguments based on their naming from the route
def extract_arguments(given_path)
      given_path_parts = RouteSet.split_path(given_path)
      path_parts.each_with_index.each_with_object({}) do |(part, index), hash|
        next unless part =~ /\A:(\w+)/
        value = given_path_parts[index]
        hash[Regexp.last_match[1]] = value
      end
    end
def extract_arguments ( given_path ) given_path_parts = RouteSet . split_path ( given_path ) path_parts . each_with_index . each_with_object ( { } ) do | ( part , index ) , hash | next unless part =~ / \A :( \w +) / value = given_path_parts [ index ] hash [ Regexp . last_match [ 1 ] ] = value end end
Extract arguments from the given path and return a hash of the arguments
based on their naming from the route
Extract arguments from the given path and return a hash of the arguments based on their naming from the route
None
Hash
given_path
<not_specific>
<not_specific>
None