class Amber::Controller::Helpers::Responders::Content

Defined in:

amber/controller/helpers/responders.cr

Constant Summary

ACCEPT_SEPARATOR_REGEX = /,|,\s/
TYPE = {html: "text/html", json: "application/json", txt: "text/plain", text: "text/plain", xml: "application/xml", js: "application/javascript"}
TYPE_EXT_REGEX = /\.(#{TYPE.keys.join("|")})$/

Constructors

Instance Method Summary

Constructor Detail

def self.new(requested_responses : Array(String)) #

[View source]

Instance Method Detail

def body #

[View source]
def html(value : String | ProcType) #

[View source]
def html(&block : -> _) #

[View source]
def js(value : String | ProcType) #

[View source]
def js(&block : -> _) #

[View source]
def json(value : String | ProcType) #

[View source]
def json(&block : -> _) #

[View source]
def json(value : Hash(Symbol | String, String)) #

[View source]
def json(**args : Object) #

[View source]
def text(value : String | ProcType) #

[View source]
def text(&block : -> _) #

[View source]
def type #

[View source]
def xml(value : String | ProcType) #

[View source]
def xml(&block : -> _) #

[View source]