Module: Notifications::Helper

Defined in:
lib/notifications/helper.rb

Instance Method Summary collapse

Instance Method Details

#notifications_count_for(origin, opts = {}) ⇒ Object



19
20
21
22
23
# File 'lib/notifications/helper.rb', line 19

def notifications_count_for(origin, opts = {})
   (opts[:container] || :div), '',
    id:    'js-notifications-count',
    class: opts[:container_class]
end

#notifications_for(destination, opts = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/notifications/helper.rb', line 3

def notifications_for(destination, opts = {})
  opts = set_default_options(opts)

   opts[:container], '',
    id:    'js-notifications-container',
    class: opts[:container_class],
    data:  {
      firebase_project_id:          Notifications.configuration.firebase_project_id,
      firebase_api_key:             Notifications.configuration.firebase_api_key,
      destination:                  destination,
      notification_container:       opts[:notification_container],
      notification_container_class: opts[:notification_container_class],
      notification_class:           opts[:notification_class]
    }
end