Class: Notification

Inherits:
React::Component::Base
  • Object
show all
Defined in:
lib/bull/notification.rb

Instance Method Summary collapse

Instance Method Details

#append(id, row) ⇒ Object



62
63
64
65
66
# File 'lib/bull/notification.rb', line 62

def append id, row
  aux = state.notifications
  aux[id] = row
  state.notifications! aux
end

#delete(id) ⇒ Object



74
75
76
77
78
# File 'lib/bull/notification.rb', line 74

def delete id
  aux = state.notifications
  aux.delete id
  state.notifications! aux
end

#renderObject



80
81
82
83
84
85
86
# File 'lib/bull/notification.rb', line 80

def render
  div(style: {position: 'absolute'}) do
    state.notifications.each_pair do |k, (animation, code, v, level)|
      div(key: k, class: animation + ' notification ' + code){v}
    end
  end
end

#update(id, row) ⇒ Object



68
69
70
71
72
# File 'lib/bull/notification.rb', line 68

def update id, row
  aux = state.notifications
  aux[id] = row
  state.notifications! aux
end