Class: Kennel::Models::Screen
- Includes:
- TemplateVariables
- Defined in:
- lib/kennel/models/screen.rb
Constant Summary collapse
- API_LIST_INCOMPLETE =
true
Constants inherited from Base
Base::LOCK, Base::READONLY_ATTRIBUTES
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json ⇒ Object
- #diff(actual) ⇒ Object
-
#initialize(project, *args) ⇒ Screen
constructor
A new instance of Screen.
- #url(id) ⇒ Object
Methods included from TemplateVariables
Methods inherited from Base
defaults, inherited, #kennel_id, #name, settings, #tracking_id, validate_setting_exists
Methods included from SubclassTracking
#recursive_subclasses, #subclasses
Constructor Details
#initialize(project, *args) ⇒ Screen
Returns a new instance of Screen.
19 20 21 22 |
# File 'lib/kennel/models/screen.rb', line 19 def initialize(project, *args) @project = project super(*args) end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
17 18 19 |
# File 'lib/kennel/models/screen.rb', line 17 def project @project end |
Class Method Details
.api_resource ⇒ Object
24 25 26 |
# File 'lib/kennel/models/screen.rb', line 24 def self.api_resource "screen" end |
Instance Method Details
#as_json ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/kennel/models/screen.rb', line 28 def as_json return @json if @json @json = { id: id, board_title: "#{board_title}#{LOCK}", description: description, widgets: , template_variables: render_template_variables } @json end |
#diff(actual) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/kennel/models/screen.rb', line 40 def diff(actual) actual.delete(:disableCog) actual.delete(:disableEditing) actual.delete(:isIntegration) actual.delete(:isShared) actual.delete(:original_title) actual.delete(:read_only) actual.delete(:resource) actual.delete(:title) actual.delete(:title_edited) actual.delete(:created_by) actual.delete(:board_bgtype) actual.delete(:height) actual.delete(:width) actual[:template_variables] ||= [] actual[:widgets].each { |w| w.delete :board_id } super end |
#url(id) ⇒ Object
59 60 61 |
# File 'lib/kennel/models/screen.rb', line 59 def url(id) Utils.path_to_url "/screen/#{id}" end |