Sha256: e9e71deaf85e897299f23c2944be29ac89bb1a1a9c6dfb2ff196be77fc141da2
Contents?: true
Size: 834 Bytes
Versions: 6
Compression:
Stored size: 834 Bytes
Contents
# frozen_string_literal: true class UniformNotifier class JavascriptConsole < Base def self.active? !!UniformNotifier.console end protected def self._inline_notify(data) message = data.values.compact.join("\n") options = UniformNotifier.console.is_a?(Hash) ? UniformNotifier.console : {} script_attributes = options[:attributes] || {} code = <<~CODE if (typeof(console) !== 'undefined' && console.log) { if (console.groupCollapsed && console.groupEnd) { console.groupCollapsed(#{'Uniform Notifier'.inspect}); console.log(#{message.inspect}); console.groupEnd(); } else { console.log(#{message.inspect}); } } CODE wrap_js_association code, script_attributes end end end
Version data entries
6 entries across 6 versions & 1 rubygems