class PlaceOS::Api::Systems::IndexParams
- PlaceOS::Api::Systems::IndexParams
- PlaceOS::Api::Params
- ActiveModel::Model
- Reference
- Object
Overview
Strong params for index method
Defined in:
placeos-rest-api/controllers/systems.crConstructors
-
.from_json(string_or_io : String | IO, trusted : Bool = false) : self
Strong params for index method
-
.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. -
.from_trusted_json(string_or_io : String | IO, root : String) : self
Strong params for index method
-
.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
-
.from_yaml(string_or_io : String | IO, trusted : Bool = false) : self
Strong params for index method
-
.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Strong params for index method
-
.new(pull : JSON::PullParser)
Strong params for index method
-
.new(bookable : Bool | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, capacity : Int32 | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, email : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, features : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, module_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, trigger_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new, zone_id : String | Nil | ActiveModel::Model::None = ::ActiveModel::Model::None.new)
Strong params for index method
-
.new(params : HTTP::Params | Hash(String, String) | Tuple(String, String))
Initialize PlaceOS::Api::Systems::IndexParams from
HTTP::Params.
Class Method Summary
-
.attributes : Array(Symbol)
Returns all attribute keys.
Instance Method Summary
-
#after_initialize(trusted : Bool)
Strong params for index method
-
#apply_defaults
Generate code to apply default values
-
#assign_attributes(bookable : Bool | Nil | Missing = Missing, capacity : Int32 | Nil | Missing = Missing, email : String | Nil | Missing = Missing, features : String | Nil | Missing = Missing, module_id : String | Nil | Missing = Missing, trigger_id : String | Nil | Missing = Missing, zone_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, root : String)
Strong params for index method
-
#assign_attributes_from_json(json)
Strong params for index method
-
#assign_attributes_from_trusted_json(json, root : String)
Strong params for index method
-
#assign_attributes_from_trusted_json(json)
Assign each field from JSON if field exists in JSON and has changed in model
-
#assign_attributes_from_trusted_yaml(yaml)
Strong params for index method
-
#assign_attributes_from_yaml(yaml)
Uses the YAML parser as JSON is valid YAML
-
#attributes
Returns a
Hashof all attribute values -
#attributes_tuple
Returns a
NamedTupleof all attribute values. -
#bookable : Bool | Nil
#bookablegetter -
#bookable=(value : Bool | Nil)
Setters
#bookablesetter -
#bookable_change : Tuple(Bool | Nil | Nil, Bool | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#bookable_changed? : Bool
Strong params for index method
-
#bookable_default : Bool | Nil
#bookable's default value - #bookable_present? : Bool
-
#bookable_was : Bool | Nil | Nil
Strong params for index method
-
#bookable_will_change! : Nil
Include
#bookablein the set of changed attributes, whether it has changed or not. -
#capacity : Int32 | Nil
#capacitygetter -
#capacity=(value : Int32 | Nil)
#capacitysetter -
#capacity_change : Tuple(Int32 | Nil | Nil, Int32 | Nil | Nil) | Nil
Returns a Tuple of the previous and the current value of an instance variable if it has changed
-
#capacity_changed? : Bool
Strong params for index method
-
#capacity_default : Int32 | Nil
#capacity's default value - #capacity_present? : Bool
-
#capacity_was : Int32 | Nil | Nil
Strong params for index method
-
#capacity_will_change! : Nil
Include
#capacityin the set of changed attributes, whether it has changed or not. -
#changed?
Check if any attributes have changed.
-
#changed_attributes
Returns a
Hashwith 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.
-
#email : String | Nil
#emailgetter -
#email=(value : String | Nil)
#emailsetter -
#email_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
-
#email_changed? : Bool
Strong params for index method
-
#email_default : String | Nil
#email's default value - #email_present? : Bool
-
#email_was : String | Nil | Nil
Strong params for index method
-
#email_will_change! : Nil
Include
#emailin the set of changed attributes, whether it has changed or not. -
#features : String | Nil
#featuresgetter -
#features=(value : String | Nil)
#featuressetter -
#features_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
-
#features_changed? : Bool
Strong params for index method
-
#features_default : String | Nil
#features's default value - #features_present? : Bool
-
#features_was : String | Nil | Nil
Strong params for index method
-
#features_will_change! : Nil
Include
#featuresin the set of changed attributes, whether it has changed or not. -
#module_id : String | Nil
#module_idgetter -
#module_id=(value : String | Nil)
#module_idsetter -
#module_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
-
#module_id_changed? : Bool
Strong params for index method
-
#module_id_default : String | Nil
#module_id's default value - #module_id_present? : Bool
-
#module_id_was : String | Nil | Nil
Strong params for index method
-
#module_id_will_change! : Nil
Include
#module_idin the set of changed attributes, whether it has changed or not. -
#persistent_attributes
Returns a
Hashof all attributes that can be persisted. -
#restore_attributes
Reset each attribute to their previous values and clears all changes.
-
#trigger_id : String | Nil
#trigger_idgetter -
#trigger_id=(value : String | Nil)
#trigger_idsetter -
#trigger_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
-
#trigger_id_changed? : Bool
Strong params for index method
-
#trigger_id_default : String | Nil
#trigger_id's default value - #trigger_id_present? : Bool
-
#trigger_id_was : String | Nil | Nil
Strong params for index method
-
#trigger_id_will_change! : Nil
Include
#trigger_idin the set of changed attributes, whether it has changed or not. -
#validate_nilability
Validate that all non-nillable fields have values.
-
#zone_id : String | Nil
#zone_idgetter -
#zone_id=(value : String | Nil)
#zone_idsetter -
#zone_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
-
#zone_id_changed? : Bool
Strong params for index method
-
#zone_id_default : String | Nil
#zone_id's default value - #zone_id_present? : Bool
-
#zone_id_was : String | Nil | Nil
Strong params for index method
-
#zone_id_will_change! : Nil
Include
#zone_idin the set of changed attributes, whether it has changed or not.
Instance methods inherited from class PlaceOS::Api::Params
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, validate! validate!
Constructor methods inherited from class PlaceOS::Api::Params
new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)new(pull : JSON::PullParser) new
Class methods inherited from class PlaceOS::Api::Params
attributes : Array(Symbol)
attributes
Constructor Detail
Strong params for index method
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">
Strong params for index method
Serialize from a trusted JSON source
Serialize from a trusted YAML source
Strong params for index method
Strong params for index method
Initialize PlaceOS::Api::Systems::IndexParams from HTTP::Params.
Class Method Detail
Instance Method Detail
Assign to multiple attributes.
Assign to mulitple attributes via HTTP::Params.
Assign each field from JSON if field exists in JSON and has changed in model
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #bookable in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #capacity in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #email in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #features in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #module_id in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include #trigger_id in the set of changed attributes, whether it has changed or not.
Returns a Tuple of the previous and the current value of an instance variable if it has changed