Module: MNotification

Included in:
BullClientController, Form
Defined in:
lib/bull/notification.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.notification_controller=(controller) ⇒ Object



8
9
10
# File 'lib/bull/notification.rb', line 8

def self.notification_controller= controller
  @notifications = controller
end

.notificationsObject



12
13
14
# File 'lib/bull/notification.rb', line 12

def self.notifications
  @notifications
end

Instance Method Details

#notificationsObject



4
5
6
# File 'lib/bull/notification.rb', line 4

def notifications
  MNotification.notifications
end

#notify_error(msg, level = 10) ⇒ Object



21
22
23
24
# File 'lib/bull/notification.rb', line 21

def notify_error msg, level=10
  puts msg
  notifications.add ['error', msg, level] if !notifications.nil?
end

#notify_info(msg, level = 10) ⇒ Object



26
27
28
29
# File 'lib/bull/notification.rb', line 26

def notify_info msg, level=10
  puts msg
  notifications.add ['info', msg, level] if !notifications.nil?
end

#notify_ok(msg, level = 10) ⇒ Object



16
17
18
19
# File 'lib/bull/notification.rb', line 16

def notify_ok msg, level=10
  puts msg
  notifications.add ['ok', msg, level] if !notifications.nil?
end