class UniformNotifier::JavascriptAlert

Public Class Methods

active?() click to toggle source
# File lib/uniform_notifier/javascript_alert.rb, line 6
def active?
  !!UniformNotifier.alert
end

Protected Class Methods

_inline_notify(data) click to toggle source
# File lib/uniform_notifier/javascript_alert.rb, line 12
def _inline_notify(data)
  message = data.values.compact.join("\n")
  options = UniformNotifier.alert.is_a?(Hash) ? UniformNotifier.alert : {}
  script_attributes = options[:attributes] || {}

  wrap_js_association "alert( #{message.inspect} );", script_attributes
end