Class: BarkestCore::UserAlert

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, ActiveModel::Validations
Defined in:
app/models/barkest_core/user_alert.rb

Overview

This model provides informational alerts to the user.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#messageObject

Returns the value of attribute message.



8
9
10
# File 'app/models/barkest_core/user_alert.rb', line 8

def message
  @message
end

#modelObject

Returns the value of attribute model.



8
9
10
# File 'app/models/barkest_core/user_alert.rb', line 8

def model
  @model
end

Instance Method Details

#typeObject



12
13
14
# File 'app/models/barkest_core/user_alert.rb', line 12

def type
  @type || :info
end

#type=(value) ⇒ Object



16
17
18
# File 'app/models/barkest_core/user_alert.rb', line 16

def type=(value)
  @type = value ? value.to_s.to_sym : nil
end

#viewObject



20
21
22
# File 'app/models/barkest_core/user_alert.rb', line 20

def view
  @view || 'generic_user_alert'
end

#view=(value) ⇒ Object



24
25
26
# File 'app/models/barkest_core/user_alert.rb', line 24

def view=(value)
  @view = value.blank? ? nil : value.to_s
end