Class: Ahoy::BaseStore
- Inherits:
-
Object
- Object
- Ahoy::BaseStore
- Defined in:
- lib/ahoy/base_store.rb
Direct Known Subclasses
Instance Attribute Summary collapse
Instance Method Summary collapse
- #authenticate(data) ⇒ Object
- #exclude? ⇒ Boolean
- #generate_id ⇒ Object
- #geocode(data) ⇒ Object
-
#initialize(options) ⇒ BaseStore
constructor
A new instance of BaseStore.
- #track_event(data) ⇒ Object
- #track_visit(data) ⇒ Object
- #visit ⇒ Object
- #visit_or_create ⇒ Object
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 = end |
Instance Attribute Details
#user ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ahoy/base_store.rb', line 24 def user @user ||= begin if Ahoy.user_method.respond_to?(:call) if Ahoy.user_method.arity == 1 Ahoy.user_method.call(controller) else Ahoy.user_method.call(controller, request) end 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
38 39 40 |
# File 'lib/ahoy/base_store.rb', line 38 def exclude? (!Ahoy.track_bots && bot?) || exclude_by_method? end |
#generate_id ⇒ Object
42 43 44 |
# File 'lib/ahoy/base_store.rb', line 42 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 |
#visit ⇒ Object
21 22 |
# File 'lib/ahoy/base_store.rb', line 21 def visit end |
#visit_or_create ⇒ Object
46 47 48 |
# File 'lib/ahoy/base_store.rb', line 46 def visit_or_create visit end |