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-2.2.1 lib/cm_admin/models/alert.rb
cm-admin-2.2.0 lib/cm_admin/models/alert.rb
cm-admin-2.1.5 lib/cm_admin/models/alert.rb
cm-admin-2.1.4 lib/cm_admin/models/alert.rb
cm-admin-2.1.3 lib/cm_admin/models/alert.rb
cm-admin-2.1.2 lib/cm_admin/models/alert.rb
cm-admin-2.1.1 lib/cm_admin/models/alert.rb
cm-admin-2.1.0 lib/cm_admin/models/alert.rb
cm-admin-2.0.2 lib/cm_admin/models/alert.rb
cm-admin-2.0.1 lib/cm_admin/models/alert.rb
cm-admin-2.0.0 lib/cm_admin/models/alert.rb
cm-admin-1.5.56 lib/cm_admin/models/alert.rb
cm-admin-1.5.55 lib/cm_admin/models/alert.rb
cm-admin-1.5.54 lib/cm_admin/models/alert.rb
cm-admin-1.5.53 lib/cm_admin/models/alert.rb
cm-admin-1.5.52 lib/cm_admin/models/alert.rb
cm-admin-1.5.51 lib/cm_admin/models/alert.rb
cm-admin-1.5.50 lib/cm_admin/models/alert.rb