abstract class Params

Included Modules

Direct Known Subclasses

Defined in:

controllers/utilities/params.cr

Constant Summary

AM_PARENT_TYPE = {:type => Params} of Nil => Nil

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Class Method Detail

def self.attributes : Array(Symbol) #

Returns all attribute keys.


Instance Method Detail

def apply_defaults #

Generate code to apply default values


def assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String)) #

Assign to mulitple attributes via HTTP::Params.


def assign_attributes(model : Params) #

Assign to multiple attributes from a model object


def assign_attributes #

Assign to multiple attributes.


def attributes #

Returns a Hash of all attribute values


def attributes_tuple #

Returns a NamedTuple of all attribute values.


def persistent_attributes #

Returns a Hash of all attributes that can be persisted.


def validate! #

Checks that the model is valid Responds with the validation errors


[View source]