class PlaceOS::Model::Trigger::Actions
- PlaceOS::Model::Trigger::Actions
- PlaceOS::Model::SubModel
- ActiveModel::Model
- Reference
- Object
Defined in:
placeos-models/trigger/actions.crConstructors
-
.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(functions : Array(PlaceOS::Model::Trigger::Actions::Function) | Nil = nil, mailers : Array(PlaceOS::Model::Trigger::Actions::Email) | Nil = nil)
-
.new(params : HTTP::Params | Hash(String, String) | Tuple(String, String))
Initialize PlaceOS::Model::Trigger::Actions from
HTTP::Params
.
Class Method Summary
-
.attributes : Array(Symbol)
Returns all attribute keys.
Instance Method Summary
-
#apply_defaults
Generate code to apply default values
-
#assign_attributes(functions : Array(PlaceOS::Model::Trigger::Actions::Function) | Missing = Missing, mailers : Array(PlaceOS::Model::Trigger::Actions::Email) | 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. -
#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.
-
#functions : Array(PlaceOS::Model::Trigger::Actions::Function)
#functions
getter -
#functions=(value : Array(PlaceOS::Model::Trigger::Actions::Function))
Override the map json
#functions
setter -
#functions_change
Returns
{ functions_was, functions }
if#functions
has changed. -
#functions_changed?
Check if
#functions
is in the set of changed attributes. -
#functions_default : Array(Function)
#functions
's default value -
#functions_was : Array(PlaceOS::Model::Trigger::Actions::Function)?
Returns the previous value of
#functions
. -
#functions_will_change!
Include
#functions
in the set of changed attributes, whether it has changed or not. -
#mailers : Array(PlaceOS::Model::Trigger::Actions::Email)
#mailers
getter -
#mailers=(value : Array(PlaceOS::Model::Trigger::Actions::Email))
#mailers
setter -
#mailers_change
Returns
{ mailers_was, mailers }
if#mailers
has changed. -
#mailers_changed?
Check if
#mailers
is in the set of changed attributes. -
#mailers_default : Array(Email)
#mailers
's default value -
#mailers_was : Array(PlaceOS::Model::Trigger::Actions::Email)?
Returns the previous value of
#mailers
. -
#mailers_will_change!
Include
#mailers
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.
- #to_json(json : JSON::Builder)
- #to_yaml(__temp_1573 : YAML::Nodes::Builder)
-
#validate_nilability
Validate that all non-nillable fields have values.
Instance methods inherited from class PlaceOS::Model::SubModel
apply_defaults
apply_defaults,
assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String))assign_attributes assign_attributes, attributes attributes, attributes_tuple attributes_tuple, persistent_attributes persistent_attributes, to_reql to_reql
Class methods inherited from class PlaceOS::Model::SubModel
attributes : Array(Symbol)
attributes
Constructor Detail
Serialize from a trusted JSON source
Serialize from a trusted YAML source
Initialize PlaceOS::Model::Trigger::Actions from HTTP::Params
.
Class Method Detail
Instance Method Detail
Assign to multiple attributes.
Assign to mulitple attributes via HTTP::Params
.
Override the map json
#functions
setter
Returns the previous value of #functions
.
Include #functions
in the set of changed attributes, whether it has changed or not.
Returns the previous value of #mailers
.