abstract class PlaceOS::Model::SubModel

Overview

Validation for embedded objects in Engine models

Included Modules

Direct Known Subclasses

Defined in:

placeos-models/base/model.cr

Constant Summary

AM_PARENT_TYPE = {:type => PlaceOS::Model::SubModel} of Nil => Nil

Class Method Summary

Instance Method Summary

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 #

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 to_reql #

RethinkDB library serializes through JSON::Any


[View source]