Sha256: 6eb1baf3c7538d790a5b7a6107556e7b8e3e5c06124d3fecc4d8ca813cc6bb33

Contents?: true

Size: 570 Bytes

Versions: 3

Compression:

Stored size: 570 Bytes

Contents

class UniformNotifier
  class JavascriptConsole < Base
    def self.active?
      UniformNotifier.console
    end

    protected

    def self._inline_notify( data )
      message = data.values.compact.join("\n")

      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
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
uniform_notifier-1.11.0 lib/uniform_notifier/javascript_console.rb
uniform_notifier-1.10.0 lib/uniform_notifier/javascript_console.rb
uniform_notifier-1.9.0 lib/uniform_notifier/javascript_console.rb