Module: RocketTracker

Defined in:
lib/rocket_tracker.rb,
lib/rocket_tracker/engine.rb,
lib/rocket_tracker/backend.rb,
lib/rocket_tracker/railtie.rb,
lib/rocket_tracker/version.rb,
lib/rocket_tracker/page_view.rb,
lib/rocket_tracker/view_helpers.rb,
lib/rocket_tracker/configuration.rb

Defined Under Namespace

Modules: ViewHelpers Classes: Backend, Configuration, Engine, PageView, Railtie

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.backendObject



39
40
41
42
43
44
45
46
# File 'lib/rocket_tracker.rb', line 39

def backend
  if config.api_key.blank?
    puts "[WARN] RocketTracker is not configured, please set api key"
    nil
  else
    @backend ||= Backend.new(config)
  end
end

.configObject



21
22
23
# File 'lib/rocket_tracker.rb', line 21

def config
  @config ||= Configuration.new
end

.configureObject



25
26
27
28
29
30
31
# File 'lib/rocket_tracker.rb', line 25

def configure
  if block_given?
    yield(config)
  else
    raise 'RocketTracker.configure requires a block'
  end
end

.subscribe!Object



33
34
35
36
37
# File 'lib/rocket_tracker.rb', line 33

def subscribe!
  ActiveSupport::Notifications.subscribe('render') do |name, start, finish, id, payload|
    p name, start, finish, id
  end
end