class NotificationController

Public Class Methods

new(panel, level) click to toggle source
# File lib/bull/notification.rb, line 35
def initialize panel, level
  @panel = panel
  @level = level
end

Public Instance Methods

add(msg) click to toggle source
# File lib/bull/notification.rb, line 40
def add msg
  return if msg[-1] < @level
  id = @@ticket
  @@ticket += 1
  @panel.append id, ['animated fadeIn'] + msg
  $window.after(4) do
    @panel.update id, ['animated fadeOut'] + msg
  end
  $window.after(5) do
    @panel.delete id
  end
end