class Orion::Controller::ParamHelpers::ParamsHash

Overview

Strong parameters support

Defined in:

orion/controller/param_helpers.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(context : Orion::Server::Context) #

Instance Method Detail

def [](key : String | Symbol) : String #

Get parameter value


def []?(key : String | Symbol) : String | Nil #

def get(key : String | Symbol, type : T.class) : T forall T #

Get parameter as specific type


def has_key?(key : String | Symbol) : Bool #

Check if parameter exists


def keys : Array(String) #

Get all parameter keys


def permit(*keys : String | Symbol) : Hash(String, String) #

Strong parameters - permit specific keys


def require(key : String | Symbol) : StrongParams #

Strong parameters - require specific key


def to_h : Hash(String, String) #

Convert to hash