Class: LWS::Generic::Model
- Inherits:
-
Spyke::Base
- Object
- Spyke::Base
- LWS::Generic::Model
- Includes:
- ActiveModel::Dirty
- Defined in:
- lib/lws/apps/generic.rb
Overview
The generic model class
This model forms the base for all LWS models.
Direct Known Subclasses
Auth::Account, Auth::App, Auth::Company, Auth::Contract, Auth::Device, Auth::License, Auth::Token, Auth::UsageReport, Auth::User, CorporateWebsite::Article, CorporateWebsite::OfficeTime, CorporateWebsite::Page, CorporateWebsite::SocialPage, CorporateWebsite::SocialPost, DigitalSignage::Channel, DigitalSignage::Channel::Group, DigitalSignage::Channel::Group::Tag, DigitalSignage::Channel::Tag, DigitalSignage::Channel::TimeSchedule, DigitalSignage::Channel::TimeSchedule::Day, DigitalSignage::Channel::TimeScheduleOverride, DigitalSignage::Display, DigitalSignage::Display::Input, DigitalSignage::Display::Resolution, DigitalSignage::Player, DigitalSignage::Player::Component, DigitalSignage::Player::Component::Part, DigitalSignage::Player::Configuration, DigitalSignage::Player::Configuration::Setting, DigitalSignage::Player::Feedback, DigitalSignage::Player::Feedback::Result, DigitalSignage::Player::Log, DigitalSignage::Player::Model, DigitalSignage::Player::Model::Capability, DigitalSignage::Player::Notification, DigitalSignage::Player::Os::Branch, DigitalSignage::Player::Os::Branch::Release, DigitalSignage::Player::Os::Package, DigitalSignage::Player::Os::Package::Version, DigitalSignage::Player::Os::Package::VersionChange, DigitalSignage::Player::Os::ReleaseChannel, DigitalSignage::Player::PredefinedConfiguration, DigitalSignage::Player::PredefinedConfiguration::Setting, DigitalSignage::Player::Request, DigitalSignage::Player::Screenshot, DigitalSignage::Player::Tag, Configuration, Maps::Map, Maps::Marker, Maps::Source, Presence::Location, Presence::Location::Map, Presence::Location::Map::Position, Presence::Person, Presence::Reader, Resource::Collection, Resource::Collection::Item, Resource::Folder, Ticket::Attachment, Ticket::Group, Ticket::Message, Ticket::Tag, Ticket::Ticket
Instance Attribute Summary collapse
-
#created_at ⇒ String
readonly
The timestamp of when the app was created.
-
#id ⇒ Integer
readonly
The (unique) ID of the model.
-
#updated_at ⇒ String
readonly
The timestamp of when the app was last updated.
-
#url ⇒ String
readonly
The URL of the model on the REST API.
-
#url_html ⇒ String
readonly
The URL of the web/HTML page of the model.
Instance Method Summary collapse
-
#reload ⇒ Hash
Reloads the attributes of this model by retrieving it from LWS via HTTP.
-
#rollback ⇒ Array<String>
Restore the attributes of this model to the previous (original) values.
-
#save ⇒ Hash, Trueclass
Saves the model to LWS via HTTP if there are any changes.
Instance Attribute Details
#created_at ⇒ String (readonly)
Returns the timestamp of when the app was created.
96 |
# File 'lib/lws/apps/generic.rb', line 96 attribute :created_at |
#id ⇒ Integer (readonly)
Returns the (unique) ID of the model.
92 |
# File 'lib/lws/apps/generic.rb', line 92 attribute :id |
#updated_at ⇒ String (readonly)
Returns the timestamp of when the app was last updated.
100 |
# File 'lib/lws/apps/generic.rb', line 100 attribute :updated_at |
#url ⇒ String (readonly)
Returns the URL of the model on the REST API.
104 |
# File 'lib/lws/apps/generic.rb', line 104 attribute :url |
#url_html ⇒ String (readonly)
Returns the URL of the web/HTML page of the model.
108 |
# File 'lib/lws/apps/generic.rb', line 108 attribute :url_html |
Instance Method Details
#reload ⇒ Hash
Reloads the attributes of this model by retrieving it from LWS via HTTP.
This also clears information about tracked changes to attribute values!
129 130 131 132 133 |
# File 'lib/lws/apps/generic.rb', line 129 def reload result = super clear_changes_information if result result end |
#rollback ⇒ Array<String>
Restore the attributes of this model to the previous (original) values.
138 139 140 |
# File 'lib/lws/apps/generic.rb', line 138 def rollback restore_attributes end |
#save ⇒ Hash, Trueclass
Saves the model to LWS via HTTP if there are any changes.
146 147 148 149 150 151 |
# File 'lib/lws/apps/generic.rb', line 146 def save return true unless changed? result = super changes_applied if result result end |