class NoticeComponent

Constants

TYPES

Public Class Methods

new(title:, messages: [], type: nil) click to toggle source
Calls superclass method
# File lib/alveole/components/notice_component.rb, line 3
def initialize(title:, messages: [], type: nil)
  super

  @type = type if TYPES.include?(type)
  @type ||= 'alert'
  @title = title
  @messages = messages
end

Public Instance Methods

render?() click to toggle source
# File lib/alveole/components/notice_component.rb, line 12
def render?
  @messages.any?
end