Class: Piwik::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/piwik/trackable.rb

Constant Summary collapse

@@use_async =
false
@@url =
Piwik::Base.load_config_from_file[:piwik_url]
@@environments =
["production","development"]
@@formats =
[:html, :all]

Class Method Summary collapse

Class Method Details

.enabled?(format) ⇒ Boolean

Checks whether the model can be tracked using piwik by checking for a piwik_id and domain fields.

This is a pretty specific use case, a more generic application tracking solution is available here:
https://github.com/Achillefs/piwik_analytics/ (this file is actually swiped from that plugin)

Returns:

  • (Boolean)

Raises:



74
75
76
77
# File 'lib/piwik/trackable.rb', line 74

def self.enabled?(format)
  raise Piwik::MissingConfiguration if url.blank?
  environments.include?(Rails.env) && formats.include?(format.to_sym)
end