Class: Widget

Inherits:
ApplicationRecord show all
Defined in:
app/models/widget.rb

Instance Method Summary collapse

Methods inherited from ApplicationRecord

graphql_type, #logger, logger

Methods included from AuditAssociations::AssociationsDefinitions

#audit_associations, #audited, #configure_dirty_associations, #normalize_associations

Instance Method Details

#default_valuesObject


13
14
15
16
17
18
19
# File 'app/models/widget.rb', line 13

def default_values
  self.sizex ||= 4
  self.sizey ||= 1
  self.col   ||= 1
  self.row   ||= 1
  self.data  ||= {}
end

#to_hashObject

Returns widget representation as the hash object Dashboard::Manager uses in memory


22
23
24
# File 'app/models/widget.rb', line 22

def to_hash
  { :template => template, :sizex => sizex, :sizey => sizey, :name => name }
end