class ActionController::Responders::SelectResponse

Overview

Helper class for selecting the response to render / execute

Defined in:

action-controller/responders.cr

Constant Summary

ACCEPTED_FORMATS = {"text/html": :html, "application/xml": :xml, "text/xml": :xml, "application/json": :json, "text/plain": :text, "application/octet-stream": :binary, "text/yaml": :yaml, "text/x-yaml": :yaml, "application/yaml": :yaml, "application/x-yaml": :yaml}

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Constructor Detail

def self.new(response : HTTP::Server::Response, formats, head_request : Bool) #

[View source]

Class Method Detail

def self.accepts(accepts_formats) #

Creates an ordered list of supported formats with requested mime types


[View source]

Instance Method Detail

def build_response #

Respond appropriately


[View source]
def options : Hash(Symbol, IO -> Nil) #

[View source]
def responses(&) #

Build a list of possible responses to the request


[View source]

Macro Detail

macro binary(obj = nil, &block) #

[View source]
macro html(obj = nil, &block) #

[View source]
macro json(obj = nil, &block) #

[View source]
macro text(obj = nil, &block) #

[View source]
macro xml(obj = nil, &block) #

[View source]
macro yaml(obj = nil, &block) #

[View source]