Module: Analytical::InstanceMethods

Defined in:
lib/analytical.rb

Instance Method Summary collapse

Instance Method Details

#analyticalObject

any method placed here will apply to instances



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/analytical.rb', line 35

def analytical
  @analytical ||= begin
    options = self.class.analytical_options.merge({
      :ssl => request.ssl?
    })
    if options[:disable_if].call(self)
      options[:modules] = options[:development_modules]
    end
    options[:session] = session if options[:use_session_store]
    if analytical_is_robot?(request.user_agent)
      options[:modules] = []
    end
    Analytical::Api.new options
  end
end