class Utils::PlaceOSHelpers::CalendarSelection

Defined in:

controllers/utilities/placeos-helpers.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class 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!

Class methods inherited from class Params

attributes : Array(Symbol) attributes

Constructor Detail

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.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

def self.new(calendars : String | Nil | Nil = nil, zone_ids : String | Nil | Nil = nil, system_ids : String | Nil | Nil = nil, features : String | Nil | Nil = nil, capacity : Int32 | Nil | Nil = nil, bookable : Bool | Nil | Nil = nil) #

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

Initialize Utils::PlaceOSHelpers::CalendarSelection from HTTP::Params.


Class Method Detail

def self.attributes : Array(Symbol) #

Returns all attribute keys.


Instance Method Detail

def apply_defaults #

Generate code to apply default values


def assign_attributes(calendars : String | Nil | Missing = Missing, zone_ids : String | Nil | Missing = Missing, system_ids : String | Nil | Missing = Missing, features : String | Nil | Missing = Missing, capacity : Int32 | Nil | Missing = Missing, bookable : Bool | 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_from_json(json) #

def assign_attributes_from_trusted_json(json) #

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 bookable : Bool | Nil #

#bookable getter


def bookable=(value : Bool | Nil) #

#bookable setter


def bookable_change #

Returns { bookable_was, bookable } if #bookable has changed.


def bookable_changed? #

Check if #bookable is in the set of changed attributes.


def bookable_default : Bool | Nil #

#bookable's default value


[View source]
def bookable_was : Bool? #

Returns the previous value of #bookable.


def bookable_will_change! #

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


def calendars : String | Nil #

#calendars getter


def calendars=(value : String | Nil) #

Override the map json #calendars setter


def calendars_change #

Returns { calendars_was, calendars } if #calendars has changed.


def calendars_changed? #

Check if #calendars is in the set of changed attributes.


def calendars_default : String | Nil #

#calendars's default value


[View source]
def calendars_was : String? #

Returns the previous value of #calendars.


def calendars_will_change! #

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


def capacity : Int32 | Nil #

#capacity getter


def capacity=(value : Int32 | Nil) #

#capacity setter


def capacity_change #

Returns { capacity_was, capacity } if #capacity has changed.


def capacity_changed? #

Check if #capacity is in the set of changed attributes.


def capacity_default : Int32 | Nil #

#capacity's default value


[View source]
def capacity_was : Int32? #

Returns the previous value of #capacity.


def capacity_will_change! #

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_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 clear_changes_information #

Reset changes for all attributes.


def features : String | Nil #

#features getter


def features=(value : String | Nil) #

#features setter


def features_change #

Returns { features_was, features } if #features has changed.


def features_changed? #

Check if #features is in the set of changed attributes.


def features_default : String | Nil #

#features's default value


[View source]
def features_was : String? #

Returns the previous value of #features.


def features_will_change! #

Include #features 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 restore_attributes #

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


def system_ids : String | Nil #

#system_ids getter


def system_ids=(value : String | Nil) #

#system_ids setter


def system_ids_change #

Returns { system_ids_was, system_ids } if #system_ids has changed.


def system_ids_changed? #

Check if #system_ids is in the set of changed attributes.


def system_ids_default : String | Nil #

#system_ids's default value


[View source]
def system_ids_was : String? #

Returns the previous value of #system_ids.


def system_ids_will_change! #

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


def to_json(json : JSON::Builder) #

def to_yaml(__temp_1818 : YAML::Nodes::Builder) #

def validate_nilability #

Validate that all non-nillable fields have values.


def zone_ids : String | Nil #

#zone_ids getter


def zone_ids=(value : String | Nil) #

#zone_ids setter


def zone_ids_change #

Returns { zone_ids_was, zone_ids } if #zone_ids has changed.


def zone_ids_changed? #

Check if #zone_ids is in the set of changed attributes.


def zone_ids_default : String | Nil #

#zone_ids's default value


[View source]
def zone_ids_was : String? #

Returns the previous value of #zone_ids.


def zone_ids_will_change! #

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