Sha256: 57dddf24cca17aaef1b215fb839524212567efa3ccf09baae18f327664710850

Contents?: true

Size: 508 Bytes

Versions: 2

Compression:

Stored size: 508 Bytes

Contents

module BarkestCore
  ##
  # This model provides informational alerts to the user.
  class UserAlert
    include ActiveModel::Model
    include ActiveModel::Validations

    attr_accessor :message, :model

    validates :message, presence: true

    def type
      @type || :info
    end

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

    def view
      @view || 'generic_user_alert'
    end

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

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
barkest_core-1.5.4.0 app/models/barkest_core/user_alert.rb
barkest_core-1.5.3.0 app/models/barkest_core/user_alert.rb