Sha256: 395f27bc5f89f50da61231c645db9762851fe78fdea967f35944f819fca2249a

Contents?: true

Size: 521 Bytes

Versions: 58

Compression:

Stored size: 521 Bytes

Contents

module CmAdmin
  module Models
    class Alert
      attr_accessor :header, :body, :type, :partial, :display_if, :html_attrs

      def initialize(attributes = {})
        set_default_values
        attributes.each do |key, value|
          send("#{key}=", value)
        end
      end

      def set_default_values
        self.header = nil
        self.body = nil
        self.type = :info
        self.partial = nil
        self.display_if = ->(_args) { true }
        self.html_attrs = {}
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
cm-admin-4.4.8 lib/cm_admin/models/alert.rb
cm-admin-4.4.6 lib/cm_admin/models/alert.rb
cm-admin-4.4.1 lib/cm_admin/models/alert.rb
cm-admin-4.4.0 lib/cm_admin/models/alert.rb
cm-admin-4.3.0 lib/cm_admin/models/alert.rb
cm-admin-4.2.1 lib/cm_admin/models/alert.rb
cm-admin-4.2.0 lib/cm_admin/models/alert.rb
cm-admin-4.1.2 lib/cm_admin/models/alert.rb
cm-admin-4.1.1 lib/cm_admin/models/alert.rb
cm-admin-4.1.0 lib/cm_admin/models/alert.rb
cm-admin-4.0.0 lib/cm_admin/models/alert.rb
cm-admin-3.0.16 lib/cm_admin/models/alert.rb
cm-admin-3.0.15 lib/cm_admin/models/alert.rb
cm-admin-3.0.14 lib/cm_admin/models/alert.rb
cm-admin-3.0.13 lib/cm_admin/models/alert.rb
cm-admin-3.0.12 lib/cm_admin/models/alert.rb
cm-admin-3.0.11 lib/cm_admin/models/alert.rb
cm-admin-3.0.10 lib/cm_admin/models/alert.rb
cm-admin-3.0.9 lib/cm_admin/models/alert.rb
cm-admin-3.0.8 lib/cm_admin/models/alert.rb