class PlaceOS::Model::Statistics
- PlaceOS::Model::Statistics
- PlaceOS::Model::ModelBase
- RethinkORM::Base
- ActiveModel::Model
- Reference
- Object
Included Modules
- RethinkORM::Timestamps
Defined in:
placeos-models/statistics.crConstant Summary
-
CALLBACKS =
{before_save: [] of Nil, after_save: [] 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: [] of Nil, after_destroy: [] of Nil}
-
Log =
::Log.for(self)
Constructors
-
.from_trusted_json(string_or_io : String | IO) : self
Serialize from a trusted JSON source
-
.from_trusted_yaml(string_or_io : String | IO) : self
Serialize from a trusted YAML source
- .new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
- .new(created_at : Time | Nil = nil, updated_at : Time | Nil = nil, modules_disconnected : Int32 | Nil = nil, triggers_active : Int32 | Nil = nil, websocket_connections : Int32 | Nil = nil, fixed_connections : Int32 | Nil = nil, core_nodes_online : Int32 | Nil = nil, ttl : Int64 | Nil = nil, id : String | Nil | Nil = nil)
-
.new(params : HTTP::Params | Hash(String, String) | Tuple(String, String))
Initialize PlaceOS::Model::Statistics from
HTTP::Params
.
Class Method Summary
-
.attributes : Array(Symbol)
Returns all attribute keys.
- .elastic
- .table_name
Instance Method Summary
-
#after_create
Base class for all Engine models
-
#after_destroy
Base class for all Engine models
-
#after_save
Base class for all Engine models
-
#after_update
Base class for all Engine models
-
#apply_defaults
Generate code to apply default values
-
#assign_attributes(created_at : Time | Missing = Missing, updated_at : Time | Missing = Missing, modules_disconnected : Int32 | Missing = Missing, triggers_active : Int32 | Missing = Missing, websocket_connections : Int32 | Missing = Missing, fixed_connections : Int32 | Missing = Missing, core_nodes_online : Int32 | Missing = Missing, ttl : Int64 | Missing = Missing, id : String | Nil | Missing = Missing)
Assign to multiple attributes.
-
#assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String))
Assign to mulitple attributes via
HTTP::Params
. - #assign_attributes_from_json(json)
- #assign_attributes_from_trusted_json(json)
- #assign_attributes_from_trusted_yaml(yaml)
-
#assign_attributes_from_yaml(yaml)
Uses the YAML parser as JSON is valid YAML
-
#attributes
Returns a
Hash
of all attribute values -
#attributes_tuple
Returns a
NamedTuple
of all attribute values. -
#before_create
Base class for all Engine models
-
#before_destroy
Base class for all Engine models
-
#before_save
Base class for all Engine models
-
#before_update
Base class for all Engine models
-
#changed?
Check if any attributes have changed.
-
#changed_attributes
Returns a
Hash
with all changed attributes. -
#changed_json(io : IO) : Nil
Serialize the set of changed attributes to JSON.
-
#changed_json : String
Serialize the set of changed attributes to JSON.
-
#changed_yaml(io : IO) : Nil
Serialize the set of changed attributes to YAML.
-
#changed_yaml : String
Serialize the set of changed attributes to YAML.
-
#clear_changes_information
Reset changes for all attributes.
-
#core_nodes_online : Int32
#core_nodes_online
getter -
#core_nodes_online=(value : Int32)
#core_nodes_online
setter -
#core_nodes_online_change
Returns
{ core_nodes_online_was, core_nodes_online }
if#core_nodes_online
has changed. -
#core_nodes_online_changed?
Check if
#core_nodes_online
is in the set of changed attributes. -
#core_nodes_online_default : Int32
#core_nodes_online
's default value -
#core_nodes_online_was : Int32?
Returns the previous value of
#core_nodes_online
. -
#core_nodes_online_will_change!
Include
#core_nodes_online
in the set of changed attributes, whether it has changed or not. -
#created_at : Time
#created_at
getter -
#created_at=(value : Time)
Override the map json
#created_at
setter -
#created_at_change
Returns
{ created_at_was, created_at }
if#created_at
has changed. -
#created_at_changed?
Check if
#created_at
is in the set of changed attributes. -
#created_at_default : Time
#created_at
's default value -
#created_at_was : Time?
Returns the previous value of
#created_at
. -
#created_at_will_change!
Include
#created_at
in the set of changed attributes, whether it has changed or not. -
#fixed_connections : Int32
#fixed_connections
getter -
#fixed_connections=(value : Int32)
#fixed_connections
setter -
#fixed_connections_change
Returns
{ fixed_connections_was, fixed_connections }
if#fixed_connections
has changed. -
#fixed_connections_changed?
Check if
#fixed_connections
is in the set of changed attributes. -
#fixed_connections_default : Int32
#fixed_connections
's default value -
#fixed_connections_was : Int32?
Returns the previous value of
#fixed_connections
. -
#fixed_connections_will_change!
Include
#fixed_connections
in the set of changed attributes, whether it has changed or not. -
#id : String | Nil
#id
getter -
#id=(value : String | Nil)
#id
setter -
#id_change
Returns
{ id_was, id }
if#id
has changed. -
#id_changed?
Check if
#id
is in the set of changed attributes. -
#id_was : String?
Returns the previous value of
#id
. -
#id_will_change!
Include
#id
in the set of changed attributes, whether it has changed or not. -
#modules_disconnected : Int32
#modules_disconnected
getter -
#modules_disconnected=(value : Int32)
#modules_disconnected
setter -
#modules_disconnected_change
Returns
{ modules_disconnected_was, modules_disconnected }
if#modules_disconnected
has changed. -
#modules_disconnected_changed?
Check if
#modules_disconnected
is in the set of changed attributes. -
#modules_disconnected_default : Int32
#modules_disconnected
's default value -
#modules_disconnected_was : Int32?
Returns the previous value of
#modules_disconnected
. -
#modules_disconnected_will_change!
Include
#modules_disconnected
in the set of changed attributes, whether it has changed or not. -
#persistent_attributes
Returns a
Hash
of all attributes that can be persisted. -
#restore_attributes
Reset each attribute to their previous values and clears all changes.
-
#run_create_callbacks(&)
Wrap a block with callbacks for the appropriate crud operation
-
#run_destroy_callbacks(&)
Base class for all Engine models
-
#run_save_callbacks(&)
Base class for all Engine models
-
#run_update_callbacks(&)
Base class for all Engine models
- #table_name
- #to_json(json : JSON::Builder)
- #to_yaml(__temp_1501 : YAML::Nodes::Builder)
-
#triggers_active : Int32
#triggers_active
getter -
#triggers_active=(value : Int32)
#triggers_active
setter -
#triggers_active_change
Returns
{ triggers_active_was, triggers_active }
if#triggers_active
has changed. -
#triggers_active_changed?
Check if
#triggers_active
is in the set of changed attributes. -
#triggers_active_default : Int32
#triggers_active
's default value -
#triggers_active_was : Int32?
Returns the previous value of
#triggers_active
. -
#triggers_active_will_change!
Include
#triggers_active
in the set of changed attributes, whether it has changed or not. -
#ttl : Int64
#ttl
getter -
#ttl=(value : Int64)
#ttl
setter -
#ttl_change
Returns
{ ttl_was, ttl }
if#ttl
has changed. -
#ttl_changed?
Check if
#ttl
is in the set of changed attributes. -
#ttl_default : Int64
#ttl
's default value -
#ttl_was : Int64?
Returns the previous value of
#ttl
. -
#ttl_will_change!
Include
#ttl
in the set of changed attributes, whether it has changed or not. -
#updated_at : Time
#updated_at
getter -
#updated_at=(value : Time)
#updated_at
setter -
#updated_at_change
Returns
{ updated_at_was, updated_at }
if#updated_at
has changed. -
#updated_at_changed?
Check if
#updated_at
is in the set of changed attributes. -
#updated_at_default : Time
#updated_at
's default value -
#updated_at_was : Time?
Returns the previous value of
#updated_at
. -
#updated_at_will_change!
Include
#updated_at
in the set of changed attributes, whether it has changed or not. -
#validate_nilability
Validate that all non-nillable fields have values.
-
#websocket_connections : Int32
#websocket_connections
getter -
#websocket_connections=(value : Int32)
#websocket_connections
setter -
#websocket_connections_change
Returns
{ websocket_connections_was, websocket_connections }
if#websocket_connections
has changed. -
#websocket_connections_changed?
Check if
#websocket_connections
is in the set of changed attributes. -
#websocket_connections_default : Int32
#websocket_connections
's default value -
#websocket_connections_was : Int32?
Returns the previous value of
#websocket_connections
. -
#websocket_connections_will_change!
Include
#websocket_connections
in the set of changed attributes, whether it has changed or not.
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(id : String | Nil | Missing = Missing)assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String)) assign_attributes, attributes attributes, attributes_tuple attributes_tuple, before_create before_create, before_destroy before_destroy, before_save before_save, before_update before_update, 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
Class methods inherited from class PlaceOS::Model::ModelBase
attributes : Array(Symbol)
attributes
Constructor Detail
Serialize from a trusted JSON source
Serialize from a trusted YAML source
Initialize PlaceOS::Model::Statistics from HTTP::Params
.
Class Method Detail
Instance Method Detail
Base class for all Engine models
Base class for all Engine models
Base class for all Engine models
Base class for all Engine models
Assign to multiple attributes.
Assign to mulitple attributes via HTTP::Params
.
Base class for all Engine models
Base class for all Engine models
Base class for all Engine models
Base class for all Engine models
Returns { core_nodes_online_was, core_nodes_online }
if #core_nodes_online
has changed.
Include #core_nodes_online
in the set of changed attributes, whether it has changed or not.
Include #created_at
in the set of changed attributes, whether it has changed or not.
Returns { fixed_connections_was, fixed_connections }
if #fixed_connections
has changed.
Include #fixed_connections
in the set of changed attributes, whether it has changed or not.
Returns { modules_disconnected_was, modules_disconnected }
if #modules_disconnected
has changed.
Check if #modules_disconnected
is in the set of changed attributes.
Include #modules_disconnected
in the set of changed attributes, whether it has changed or not.
Base class for all Engine models
Base class for all Engine models
Base class for all Engine models
Returns { triggers_active_was, triggers_active }
if #triggers_active
has changed.
Include #triggers_active
in the set of changed attributes, whether it has changed or not.
Include #ttl
in the set of changed attributes, whether it has changed or not.
Include #updated_at
in the set of changed attributes, whether it has changed or not.
Returns { websocket_connections_was, websocket_connections }
if #websocket_connections
has changed.
Check if #websocket_connections
is in the set of changed attributes.
Include #websocket_connections
in the set of changed attributes, whether it has changed or not.