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

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

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

Validation for embedded objects in Engine models


def self.new(pull : JSON::PullParser) #

Validation for embedded objects in Engine models


def self.new(rs : DB::ResultSet) #

Validation for embedded objects in Engine models


Class Method Detail

def self.attributes : Array(Symbol) #

Returns all attribute keys.


def self.from_rs(rs : DB::ResultSet) #

Validation for embedded objects in Engine models


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 : PlaceOS::Model::SubModel) #

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

RethinkDB library serializes through JSON::Any