class PlaceOS::Model::ControlSystem

Included Modules

Defined in:

placeos-models/control_system.cr

Constant Summary

CALLBACKS = {before_save: [:check_playlists, :check_zones, :check_modules] of Nil, after_save: [:update_triggers] of Nil, before_create: [do self.created_at = self.updated_at = Time.utc end] of Nil, after_create: [] of Nil, before_update: [do self.updated_at = Time.utc end] of Nil, after_update: [] of Nil, before_destroy: [:destroy_settings_and_versions, :destroy_metadata_and_versions, :destroy_system_triggers, :cleanup_modules] of Nil, after_destroy: [] of Nil}
Log = ::Log.for(self)

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module PlaceOS::Model::Playlist::Checker

check_playlists check_playlists

Instance methods inherited from module PlaceOS::Model::Utilities::MetadataHelper

metadata(name : String | Nil = nil) : Array(Metadata) metadata

Instance methods inherited from module PlaceOS::Model::Utilities::SettingsHelper

all_settings : Hash(YAML::Any, YAML::Any) all_settings, settings : Array(Settings) settings, settings_at(encryption_level : Encryption::Level) settings_at, settings_at?(encryption_level : Encryption::Level) settings_at?, settings_hierarchy : Array(Settings) settings_hierarchy, settings_json : String settings_json

Instance methods inherited from class PlaceOS::Model::ModelBase

after_create after_create, after_destroy after_destroy, after_save after_save, after_update after_update, apply_defaults apply_defaults, assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String))
assign_attributes(model : PlaceOS::Model::ModelBase)
assign_attributes
assign_attributes
, attributes attributes, attributes_tuple attributes_tuple, before_create before_create, before_destroy before_destroy, before_save before_save, before_update before_update, invoke_props invoke_props, persistent_attributes persistent_attributes, run_create_callbacks(&) run_create_callbacks, run_destroy_callbacks(&) run_destroy_callbacks, run_save_callbacks(&) run_save_callbacks, run_update_callbacks(&) run_update_callbacks

Constructor methods inherited from class PlaceOS::Model::ModelBase

new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
new(pull : JSON::PullParser)
new(rs : DB::ResultSet)
new

Class methods inherited from class PlaceOS::Model::ModelBase

attributes : Array(Symbol) attributes, auto_generate_id : Bool auto_generate_id, from_rs(rs : DB::ResultSet) from_rs, primary_key : Symbol primary_key

Instance methods inherited from module PlaceOS::Model::Associations

format_list_for_postgres(list : Enumerable(String)) : String format_list_for_postgres, reset_associations reset_associations

Class methods inherited from module PlaceOS::Model::Associations

format_list_for_postgres(list : Enumerable(String)) : String format_list_for_postgres

Macros inherited from module PlaceOS::Model::Associations

belongs_to(parent_class, dependent = :none, association_name = nil, foreign_key = nil, presence = false, pk_type = nil, serialize = true) belongs_to, has_many(child_class, collection_name = nil, dependent = :none, foreign_key = nil, serialize = false) has_many, has_one(child_class, dependent = :none, association_name = nil, presence = false) has_one

Constructor Detail

def self.from_json(string_or_io : String | IO, trusted : Bool = false) : self #

def self.from_json(string_or_io : String | IO, root : String, trusted : Bool = false) : self #

Deserializes the given JSON in string_or_io into an instance of self, assuming the JSON consists of an JSON object with key root, and whose value is the value to deserialize. Will not deserialise from fields with mass_assign: false

class User < ActiveModel::Model
  attribute name : String
  attribute google_id : UUID, mass_assign: false
end

User.from_json(%({"main": {"name": "Jason", "google_id": "f6f70bfb-c882-446d-8758-7ce47db39620"}}), root: "main") # => #<User:0x103131b20 @name="Jason">

def self.from_trusted_json(string_or_io : String | IO, root : String) : self #

def self.from_trusted_json(string_or_io : String | IO) : self #

Serialize from a trusted JSON source


def self.from_trusted_yaml(string_or_io : String | IO) : self #

Serialize from a trusted YAML source


def self.from_yaml(string_or_io : String | IO, trusted : Bool = false) : self #

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

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

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

def self.new(created_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, updated_at : Time | ActiveModel::Model::None = ::ActiveModel::Model::None.new, name : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, description : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, features : Set(String) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, email : PlaceOS::Model::Email | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, bookable : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, public : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, display_name : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, code : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, type : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, capacity : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, map_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, images : Array(String) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, timezone : Time::Location | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, support_url : String | ActiveModel::Model::None = ::ActiveModel::Model::None.new, version : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, installed_ui_devices : Int32 | ActiveModel::Model::None = ::ActiveModel::Model::None.new, zones : Array(String) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, modules : Array(String) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, orientation : PlaceOS::Model::Playlist::Orientation | ActiveModel::Model::None = ::ActiveModel::Model::None.new, playlists : Array(String) | ActiveModel::Model::None = ::ActiveModel::Model::None.new, signage : Bool | ActiveModel::Model::None = ::ActiveModel::Model::None.new, id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new) #

def self.new(params : HTTP::Params | Hash(String, String) | Tuple(String, String)) #

Initialize PlaceOS::Model::ControlSystem from HTTP::Params.


Class Method Detail

def self.add_module(control_system_id : String, module_id : String) #

def self.attributes : Array(Symbol) #

Returns all attribute keys.


def self.auto_generate_id : Bool #

def self.by_module_id(id) #

def self.by_zone_id(id) #

def self.changes(id : PrimaryKeyType = nil) : ChangeFeed #

Changefeed at row (if #id passed) or whole table level. Returns a ChangeFeed instance which can be used to invoke async callbacks via on or use blocking Iterator via each method.


def self.elastic #

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

def self.in_zone(id) #

DEPRECATED Use .by_zone_id


def self.on_error(err : Exception | IO::Error) #

def self.primary_key : Symbol #

def self.remove_module(control_system_id : String, module_id : String) #

def self.table_name #

def self.using_module(id) #

DEPRECATED Use .by_module_id


def self.with_playlists(ids : Enumerable(String)) #

Instance Method Detail

def add_module(module_id : String) #

Removes the module from the system and deletes it if not used elsewhere


def after_create #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def after_destroy #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def after_initialize(trusted : Bool) #

def after_save #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def after_update #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def all_playlists : Hash(String, Array(String)) #

def apply_defaults #

Generate code to apply default values


def assign_attributes(created_at : Time | Missing = Missing, updated_at : Time | Missing = Missing, name : String | Missing = Missing, description : String | Missing = Missing, features : Set(String) | Missing = Missing, email : PlaceOS::Model::Email | Nil | Missing = Missing, bookable : Bool | Missing = Missing, public : Bool | Missing = Missing, display_name : String | Nil | Missing = Missing, code : String | Nil | Missing = Missing, type : String | Nil | Missing = Missing, capacity : Int32 | Missing = Missing, map_id : String | Nil | Missing = Missing, images : Array(String) | Missing = Missing, timezone : Time::Location | Nil | Missing = Missing, support_url : String | Missing = Missing, version : Int32 | Missing = Missing, installed_ui_devices : Int32 | Missing = Missing, zones : Array(String) | Missing = Missing, modules : Array(String) | Missing = Missing, orientation : PlaceOS::Model::Playlist::Orientation | Missing = Missing, playlists : Array(String) | Missing = Missing, signage : Bool | Missing = Missing, id : String | Nil | Missing = Missing) #

Assign to multiple attributes.


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::ControlSystem) #

Assign to multiple attributes from a model object


def assign_attributes_from_json(json, root : String) #

def assign_attributes_from_json(json) #

def assign_attributes_from_trusted_json(json, root : String) #

def assign_attributes_from_trusted_json(json) #

Assign each field from JSON if field exists in JSON and has changed in model


def assign_attributes_from_trusted_yaml(yaml) #

def assign_attributes_from_yaml(yaml) #

Uses the YAML parser as JSON is valid YAML


def attributes #

Returns a Hash of all attribute values


def attributes_tuple #

Returns a NamedTuple of all attribute values.


def before_create #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def before_destroy #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def before_save #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def before_update #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def bookable : Bool #

#bookable getter


def bookable=(value : Bool) #

#bookable setter


def bookable? : Bool | Nil #

def bookable_assigned? : Bool #

def bookable_change : Tuple(Bool | Nil, Bool | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def bookable_changed? : Bool #

def bookable_default : Bool #

#bookable's default value


def bookable_present? : Bool #

def bookable_was : Bool | Nil #

def bookable_will_change! : Nil #

Include #bookable in the set of changed attributes, whether it has changed or not.


def capacity : Int32 #

#capacity getter


def capacity=(value : Int32) #

#capacity setter


def capacity? : Int32 | Nil #

def capacity_assigned? : Bool #

def capacity_change : Tuple(Int32 | Nil, Int32 | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def capacity_changed? : Bool #

def capacity_default : Int32 #

#capacity's default value


def capacity_present? : Bool #

def capacity_was : Int32 | Nil #

def capacity_will_change! : Nil #

Include #capacity in the set of changed attributes, whether it has changed or not.


def changed? #

Check if any attributes have changed.


def changed_attributes #

Returns a Hash with all changed attributes.


def changed_json(io : IO) : Nil #

Serialize the set of changed attributes to JSON.


def changed_json : String #

Serialize the set of changed attributes to JSON.


def changed_persist_attributes #

def changed_yaml(io : IO) : Nil #

Serialize the set of changed attributes to YAML.


def changed_yaml : String #

Serialize the set of changed attributes to YAML.


def check_modules #

ensure all the modules are valid and exist


def cleanup_modules #

Remove Modules not associated with any other systems

NOTE Includes compulsory associated Logic Modules


def clear_changes_information #

Reset changes for all attributes.


def code : String | Nil #

#code getter


def code=(value : String | Nil) #

#code setter


def code_assigned? : Bool #

def code_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def code_changed? : Bool #

def code_default : String | Nil #

#code's default value


def code_present? : Bool #

def code_was : String | Nil | Nil #

def code_will_change! : Nil #

Include #code in the set of changed attributes, whether it has changed or not.


def created_at : Time #

#created_at getter


def created_at=(value : Time) #

Setters #created_at setter


def created_at? : Time | Nil #

def created_at_assigned? : Bool #

def created_at_change : Tuple(Time | Nil, Time | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def created_at_changed? : Bool #

def created_at_default : Time #

#created_at's default value


def created_at_present? : Bool #

def created_at_was : Time | Nil #

def created_at_will_change! : Nil #

Include #created_at in the set of changed attributes, whether it has changed or not.


def description : String #

#description getter


def description=(value : String) #

#description setter


def description? : String | Nil #

def description_assigned? : Bool #

def description_change : Tuple(String | Nil, String | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def description_changed? : Bool #

def description_default : String #

#description's default value


def description_present? : Bool #

def description_was : String | Nil #

def description_will_change! : Nil #

Include #description in the set of changed attributes, whether it has changed or not.


def destroy_metadata_and_versions #

Metadata belonging to this control_system


def destroy_settings_and_versions #

Encrypted yaml settings, with metadata


def destroy_system_triggers #

Single System triggers


def display_name : String | Nil #

#display_name getter


def display_name=(value : String | Nil) #

#display_name setter


def display_name_assigned? : Bool #

def display_name_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def display_name_changed? : Bool #

def display_name_default : String | Nil #

#display_name's default value


def display_name_present? : Bool #

def display_name_was : String | Nil | Nil #

def display_name_will_change! : Nil #

Include #display_name in the set of changed attributes, whether it has changed or not.


def email : PlaceOS::Model::Email | Nil #

#email getter


def email=(value : PlaceOS::Model::Email | Nil) #

#email setter


def email_assigned? : Bool #

def email_change : Tuple(PlaceOS::Model::Email | Nil | Nil, PlaceOS::Model::Email | Nil | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def email_changed? : Bool #

def email_default : Email | Nil #

#email's default value


def email_present? : Bool #

def email_was : PlaceOS::Model::Email | Nil | Nil #

def email_will_change! : Nil #

Include #email in the set of changed attributes, whether it has changed or not.


def features : Set(String) #

#features getter


def features=(value : Set(String)) #

#features setter


def features? : Set(String) | Nil #

Room search meta-data Building + Level are both filtered using zones


def features_assigned? : Bool #

def features_change : Tuple(Set(String) | Nil, Set(String) | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def features_changed? : Bool #

def features_default : Set(String) #

#features's default value


def features_present? : Bool #

Room search meta-data Building + Level are both filtered using zones


def features_was : Set(String) | Nil #

def features_will_change! : Nil #

Include #features in the set of changed attributes, whether it has changed or not.


def id : String | Nil #

#id getter


def id=(value : String | Nil) #

#id setter


def id? : String | Nil | Nil #
Description copied from class PgORM::Base

Same as #id but may return nil when the record hasn't been saved instead of raising.


def id_assigned? : Bool #

def id_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def id_changed? : Bool #

def id_default : String | Nil #

#id's default value


def id_present? : Bool #

def id_was : String | Nil | Nil #

def id_will_change! : Nil #

Include #id in the set of changed attributes, whether it has changed or not.


def images : Array(String) #

#images getter


def images=(value : Array(String)) #

#images setter


def images? : Array(String) | Nil #

Array of URLs to images for a system


def images_assigned? : Bool #

def images_change : Tuple(Array(String) | Nil, Array(String) | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def images_changed? : Bool #

def images_default : Array(String) #

#images's default value


def images_present? : Bool #

Array of URLs to images for a system


def images_was : Array(String) | Nil #

def images_will_change! : Nil #

Include #images in the set of changed attributes, whether it has changed or not.


def installed_ui_devices : Int32 #

def installed_ui_devices=(value : Int32) #

def installed_ui_devices? : Int32 | Nil #

The number of UI devices that are always available in the room i.e. the number of iPads mounted on the wall


def installed_ui_devices_assigned? : Bool #

def installed_ui_devices_change : Tuple(Int32 | Nil, Int32 | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def installed_ui_devices_changed? : Bool #

def installed_ui_devices_default : Int32 #

#installed_ui_devices's default value


def installed_ui_devices_present? : Bool #

The number of UI devices that are always available in the room i.e. the number of iPads mounted on the wall


def installed_ui_devices_was : Int32 | Nil #

def installed_ui_devices_will_change! : Nil #

Include #installed_ui_devices in the set of changed attributes, whether it has changed or not.


def invoke_props #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def map_id : String | Nil #

#map_id getter


def map_id=(value : String | Nil) #

#map_id setter


def map_id_assigned? : Bool #

def map_id_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def map_id_changed? : Bool #

def map_id_default : String | Nil #

#map_id's default value


def map_id_present? : Bool #

def map_id_was : String | Nil | Nil #

def map_id_will_change! : Nil #

Include #map_id in the set of changed attributes, whether it has changed or not.


def metadata_and_versions #

Metadata belonging to this control_system


def module_data #

Obtains the control system's modules as json

FIXME Dreadfully needs optimisation, i.e. subset serialisation


def modules : Array(String) #

#modules getter


def modules=(value : Array(String)) #

#modules setter


def modules? : Array(String) | Nil #

def modules_assigned? : Bool #

def modules_change : Tuple(Array(String) | Nil, Array(String) | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def modules_changed? : Bool #

def modules_default : Array(String) #

#modules's default value


def modules_present? : Bool #

def modules_was : Array(String) | Nil #

def modules_will_change! : Nil #

Include #modules in the set of changed attributes, whether it has changed or not.


def modules_with_single_occurrence : Array(Module) #

def name : String #

#name getter


def name=(value : String) #

#name setter


def name? : String | Nil #

def name_assigned? : Bool #

def name_change : Tuple(String | Nil, String | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def name_changed? : Bool #

def name_default : String #

#name's default value


def name_present? : Bool #

def name_was : String | Nil #

def name_will_change! : Nil #

Include #name in the set of changed attributes, whether it has changed or not.


#orientation getter


def orientation=(value : PlaceOS::Model::Playlist::Orientation) #

#orientation setter


def orientation? : PlaceOS::Model::Playlist::Orientation | Nil #

Systems as digital signage displays playlists can be assigned directly to displays or to zones playlists in zones will only be loaded if they have matching orientations


def orientation_assigned? : Bool #

def orientation_change : Tuple(PlaceOS::Model::Playlist::Orientation | Nil, PlaceOS::Model::Playlist::Orientation | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def orientation_changed? : Bool #

def orientation_default : Playlist::Orientation #

#orientation's default value


def orientation_present? : Bool #

Systems as digital signage displays playlists can be assigned directly to displays or to zones playlists in zones will only be loaded if they have matching orientations


def orientation_was : PlaceOS::Model::Playlist::Orientation | Nil #

def orientation_will_change! : Nil #

Include #orientation in the set of changed attributes, whether it has changed or not.


def persistent_attributes #

Returns a Hash of all attributes that can be persisted.


def playlists : Array(String) #

#playlists getter


def playlists=(value : Array(String)) #

#playlists setter


def playlists? : Array(String) | Nil #

def playlists_assigned? : Bool #

def playlists_change : Tuple(Array(String) | Nil, Array(String) | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def playlists_changed? : Bool #

def playlists_default : Array(String) #

#playlists's default value


def playlists_last_updated(playlists : Hash(String, Array(String)) = all_playlists) : Time #

def playlists_present? : Bool #

def playlists_was : Array(String) | Nil #

def playlists_will_change! : Nil #

Include #playlists in the set of changed attributes, whether it has changed or not.


def public : Bool #

#public getter


def public=(value : Bool) #

#public setter


def public? : Bool | Nil #

def public_assigned? : Bool #

def public_change : Tuple(Bool | Nil, Bool | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def public_changed? : Bool #

def public_default : Bool #

#public's default value


def public_present? : Bool #

def public_was : Bool | Nil #

def public_will_change! : Nil #

Include #public in the set of changed attributes, whether it has changed or not.


def remove_module(module_id : String) #

Removes the module from the system and deletes it if not used elsewhere


def restore_attributes #

Reset each attribute to their previous values and clears all changes.


def run_create_callbacks(&) #

Wrap a block with callbacks for the appropriate crud operation


def run_destroy_callbacks(&) #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def run_save_callbacks(&) #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def run_update_callbacks(&) #
Description copied from class PlaceOS::Model::ModelBase

Base class for all Engine models


def settings_and_versions #

Encrypted yaml settings, with metadata


def settings_hierarchy : Array(Settings) #

Collect Settings ordered by hierarchy

Control System < Zone/n < Zone/(n-1) < ... < Zone/0


def signage : Bool #

#signage getter


def signage=(value : Bool) #

#signage setter


def signage? : Bool | Nil #

def signage_assigned? : Bool #

def signage_change : Tuple(Bool | Nil, Bool | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def signage_changed? : Bool #

def signage_default : Bool #

#signage's default value


def signage_present? : Bool #

def signage_was : Bool | Nil #

def signage_will_change! : Nil #

Include #signage in the set of changed attributes, whether it has changed or not.


def support_url : String #

#support_url getter


def support_url=(value : String) #

#support_url setter


def support_url? : String | Nil #

Provide a field for simplifying support


def support_url_assigned? : Bool #

def support_url_change : Tuple(String | Nil, String | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def support_url_changed? : Bool #

def support_url_default : String #

#support_url's default value


def support_url_present? : Bool #

Provide a field for simplifying support


def support_url_was : String | Nil #

def support_url_will_change! : Nil #

Include #support_url in the set of changed attributes, whether it has changed or not.


def system_triggers #

Single System triggers


def table_name #

def timezone : Time::Location | Nil #

#timezone getter


def timezone=(value : Time::Location | Nil) #

#timezone setter


def timezone_assigned? : Bool #

def timezone_change : Tuple(Time::Location | Nil | Nil, Time::Location | Nil | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def timezone_changed? : Bool #

def timezone_default : Time::Location | Nil #

#timezone's default value


def timezone_present? : Bool #

def timezone_was : Time::Location | Nil | Nil #

def timezone_will_change! : Nil #

Include #timezone in the set of changed attributes, whether it has changed or not.


def triggers #

Triggers


def type : String | Nil #

#type getter


def type=(value : String | Nil) #

#type setter


def type_assigned? : Bool #

def type_change : Tuple(String | Nil | Nil, String | Nil | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def type_changed? : Bool #

def type_default : String | Nil #

#type's default value


def type_present? : Bool #

def type_was : String | Nil | Nil #

def type_will_change! : Nil #

Include #type in the set of changed attributes, whether it has changed or not.


def updated_at : Time #

#updated_at getter


def updated_at=(value : Time) #

#updated_at setter


def updated_at? : Time | Nil #

def updated_at_assigned? : Bool #

def updated_at_change : Tuple(Time | Nil, Time | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def updated_at_changed? : Bool #

def updated_at_default : Time #

#updated_at's default value


def updated_at_present? : Bool #

def updated_at_was : Time | Nil #

def updated_at_will_change! : Nil #

Include #updated_at in the set of changed attributes, whether it has changed or not.


def validate_nilability #

Validate that all non-nillable fields have values.


def version : Int32 #

#version getter


def version=(value : Int32) #

#version setter


def version? : Int32 | Nil #

def version_assigned? : Bool #

def version_change : Tuple(Int32 | Nil, Int32 | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def version_changed? : Bool #

def version_default : Int32 #

#version's default value


def version_present? : Bool #

def version_was : Int32 | Nil #

def version_will_change! : Nil #

Include #version in the set of changed attributes, whether it has changed or not.


def zone_data #

Obtains the control system's zones as json


def zones : Array(String) #

#zones getter


def zones=(value : Array(String)) #

#zones setter


def zones? : Array(String) | Nil #

IDs of associated models


def zones_assigned? : Bool #

def zones_change : Tuple(Array(String) | Nil, Array(String) | Nil) | Nil #

Returns a Tuple of the previous and the current value of an instance variable if it has changed


def zones_changed? : Bool #

def zones_default : Array(String) #

#zones's default value


def zones_present? : Bool #

IDs of associated models


def zones_was : Array(String) | Nil #

def zones_will_change! : Nil #

Include #zones in the set of changed attributes, whether it has changed or not.