Class: Ahoy::BaseStore

Inherits:
Object
  • Object
show all
Defined in:
lib/ahoy/base_store.rb

Direct Known Subclasses

DatabaseStore

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ BaseStore

Returns a new instance of BaseStore.



5
6
7
# File 'lib/ahoy/base_store.rb', line 5

def initialize(options)
  @options = options
end

Instance Attribute Details

#userObject



24
25
26
27
28
29
30
31
32
# File 'lib/ahoy/base_store.rb', line 24

def user
  @user ||= begin
    if Ahoy.user_method.respond_to?(:call)
      Ahoy.user_method.call(controller)
    else
      controller.send(Ahoy.user_method) if controller.respond_to?(Ahoy.user_method, true)
    end
  end
end

Instance Method Details

#authenticate(data) ⇒ Object



18
19
# File 'lib/ahoy/base_store.rb', line 18

def authenticate(data)
end

#exclude?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/ahoy/base_store.rb', line 34

def exclude?
  (!Ahoy.track_bots && bot?) || exclude_by_method?
end

#generate_idObject



38
39
40
# File 'lib/ahoy/base_store.rb', line 38

def generate_id
  Ahoy.token_generator.call
end

#geocode(data) ⇒ Object



15
16
# File 'lib/ahoy/base_store.rb', line 15

def geocode(data)
end

#track_event(data) ⇒ Object



12
13
# File 'lib/ahoy/base_store.rb', line 12

def track_event(data)
end

#track_visit(data) ⇒ Object



9
10
# File 'lib/ahoy/base_store.rb', line 9

def track_visit(data)
end

#visitObject



21
22
# File 'lib/ahoy/base_store.rb', line 21

def visit
end

#visit_or_createObject



42
43
44
# File 'lib/ahoy/base_store.rb', line 42

def visit_or_create
  visit
end