class PluginRoutes

Overview

Implementation of a TODO application

Defined in:

controllers/plugin_routes.cr

Constant Summary

PARSER_LIST = ["application/json"]

Implementation of a TODO application

RESPONDER_LIST = ["application/json"]

Implementation of a TODO application

TODOS = [] of Todo

Class Method Summary

Instance Method Summary

Instance methods inherited from class Application

bad_media_type(error) : AC::Error::ContentResponse bad_media_type, invalid_param(error) : AC::Error::ParameterResponse invalid_param, resource_not_found(error) : AC::Error::CommonResponse resource_not_found, set_cors_headers set_cors_headers, set_request_id set_request_id

Class Method Detail

def self.base_route #

Helper for obtaining base route


def self.index(hash_parts : Hash(String | Symbol, Nil | Bool | Int32 | Int64 | Float32 | Float64 | String | Symbol) | Nil = nil, **tuple_parts) #

Helper methods for performing redirect_to calls


Instance Method Detail

def base_route(*args, **options) #

Helper for obtaining base route


def base_route(*args, **options, &) #

Helper for obtaining base route


def complete(index : Int32) : Nil #

mark the todo, at the index provided, as completed

indexes start at 0


[View source]
def create(todo : Todo) : Todo #

append a new todo to the end of the list


[View source]
def index : Array(Todo) #

returns the list of todos


[View source]
def show(index : Int32) : Todo #

return the todo at the index provided, indexes start at 0


[View source]
def update(index : Int32, todo : Todo) : Todo #

modify the todo at the index provided

indexes start at 0 and this will also set completed to false


[View source]