Sha256: 486856e9c69b3af00ace817565d1910b6011bb0a0cd1af93e14f6320801104e1
Contents?: true
Size: 994 Bytes
Versions: 13
Compression:
Stored size: 994 Bytes
Contents
class Rack::App::Router::Base def call(env) request_method= env[Rack::REQUEST_METHOD] path_info= env[Rack::PATH_INFO] context = fetch_context(request_method, path_info) return unless context.is_a?(Hash) and not context[:endpoint].nil? format_env(context, env) context[:endpoint].call(env) end def format_env(context, env) end def endpoints @endpoints ||= [] end def register_endpoint!(request_method, request_path, description, endpoint) endpoints.push( { :request_method => request_method, :request_path => Rack::App::Utils.normalize_path(request_path), :description => description, :endpoint => endpoint } ) compile_registered_endpoints! return endpoint end protected def fetch_context(request_method, request_path) raise('IMPLEMENTATION MISSING ERROR') end def compile_registered_endpoints! raise('IMPLEMENTATION MISSING ERROR') end end
Version data entries
13 entries across 13 versions & 1 rubygems