From 5892d900ff52ccb26b21c8c2e50b905b6e7e272c Mon Sep 17 00:00:00 2001 From: Sdogruyol Date: Thu, 29 Oct 2015 17:16:29 +0200 Subject: [PATCH] Added documentation for context, param_parser and route --- src/kemal/context.cr | 2 ++ src/kemal/param_parser.cr | 3 +++ src/kemal/route.cr | 3 +++ 3 files changed, 8 insertions(+) diff --git a/src/kemal/context.cr b/src/kemal/context.cr index 3a52a50..5378b06 100644 --- a/src/kemal/context.cr +++ b/src/kemal/context.cr @@ -1,3 +1,5 @@ +# Context is the environment which holds request/response specific +# information such as params, content_type e.g class Kemal::Context getter request getter params diff --git a/src/kemal/param_parser.cr b/src/kemal/param_parser.cr index da0e786..87b2181 100644 --- a/src/kemal/param_parser.cr +++ b/src/kemal/param_parser.cr @@ -1,3 +1,6 @@ +# ParamParser parses the request contents including query_params and body +# and converts them into a params hash which you can within the environment +# context. class Kemal::ParamParser def initialize(@route, @request) @route_components = route.components diff --git a/src/kemal/route.cr b/src/kemal/route.cr index ee3b8fc..573dcae 100644 --- a/src/kemal/route.cr +++ b/src/kemal/route.cr @@ -1,3 +1,6 @@ +# Route is the main building block of Kemal. +# It takes 3 parameters method, path and a block to specify +# what action to be done if the route is matched. class Kemal::Route getter handler getter components