Module: Path::Reporting

Defined in:
lib/path/reporting.rb,
lib/path/reporting/version.rb,
lib/path/reporting/analytics.rb,
lib/path/reporting/configuration.rb,
lib/path/reporting/types/trigger.rb,
lib/path/reporting/types/user_type.rb,
lib/path/reporting/analytics/console.rb,
lib/path/reporting/analytics/amplitude.rb,
lib/path/reporting/analytics/configuration.rb

Overview

The Reporting module is our general, all-purpose reporting tool for analytics, metrics, performance, and any other data. This module is meant to be a one-stop shop for all of our ruby code to import and have everything they need to track all the things

Defined Under Namespace

Classes: Analytics, Configuration, Trigger, UserType

Constant Summary collapse

VERSION =

Current version of the module

"0.2.3"

Class Method Summary collapse

Class Method Details

.analyticsAnalytics

Returns the configured analytics reporting module.

Returns:

  • (Analytics)

    the configured analytics reporting module

Raises:

  • (Error)

    if the Path:Reporting module has not been initialized



52
53
54
55
56
# File 'lib/path/reporting.rb', line 52

def analytics
  raise Error, "Must call init on Path::Reporting library before using" unless @initialized

  @analytics
end

.init {|config| ... } ⇒ self

Initialize our reporting setup. This is required to call before the module is ready to use.

To configure this module, pass in a block that accepts a Configuration parameter. Using this parameter you can setup any reporting systems that you need.

Each sub-type of reporting will have its own configuration. For example, to configure analytics reporting, you can use the analytics property on the Configuration object passed in, which will be an instance of Path::Reporting::Analytics::Configuration.

Examples:

Basic analytics setup

Path::Reporting.init do |config|
  config.analytics.logger = Rails.logger
end

If no configuration is needed, you still need to call this method

Path::Reporting.init

Yield Parameters:

  • config (Configuration)

    the Configuration object to set any and all configuration on

Returns:

  • (self)

See Also:



41
42
43
44
45
46
47
48
# File 'lib/path/reporting.rb', line 41

def init
  @initialized = true
  @config = Configuration.new
  yield(@config) if block_given?

  @analytics = Path::Reporting::Analytics.new @config
  self
end