Class: Piwik::Config

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

Constant Summary collapse

@@use_async =
false
@@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:



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

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

.urlObject



66
67
68
# File 'lib/piwik/trackable.rb', line 66

def self.url
  Piwik.piwik_url
end