Class: ActiveTracker::Configuration
- Inherits:
-
Object
- Object
- ActiveTracker::Configuration
show all
- Defined in:
- lib/active_tracker/configuration.rb
Defined Under Namespace
Classes: PluginInvalidError
Class Method Summary
collapse
Class Method Details
.authentication(&block) ⇒ Object
54
55
56
57
58
59
|
# File 'lib/active_tracker/configuration.rb', line 54
def self.authentication(&block)
if block
@@authentication = block
end
@@authentication ||= nil
end
|
.authentication=(value) ⇒ Object
61
62
63
|
# File 'lib/active_tracker/configuration.rb', line 61
def self.authentication=(value)
@@authentication = value
end
|
.mountpoint ⇒ Object
33
34
35
|
# File 'lib/active_tracker/configuration.rb', line 33
def self.mountpoint
@@mountpoint ||= "activetracker"
end
|
.mountpoint=(path) ⇒ Object
41
42
43
|
# File 'lib/active_tracker/configuration.rb', line 41
def self.mountpoint=(path)
@@mountpoint = path
end
|
.per_page ⇒ Object
49
50
51
52
|
# File 'lib/active_tracker/configuration.rb', line 49
def self.per_page
@@per_page ||= 20
@@per_page.to_i
end
|
.per_page=(value) ⇒ Object
45
46
47
|
# File 'lib/active_tracker/configuration.rb', line 45
def self.per_page=(value)
@@per_page = value
end
|
.plugins ⇒ Object
3
4
5
6
7
8
|
# File 'lib/active_tracker/configuration.rb', line 3
def self.plugins
@@plugins ||= [
ActiveTracker::Plugin::Request,
]
@@plugins
end
|
.plugins=(items) ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/active_tracker/configuration.rb', line 10
def self.plugins=(items)
items.each do |i|
if i.respond_to?(:register)
i.register
else
raise PluginInvalidError.new("#{i.name} doesn't correctly implement the ActiveTracker API")
end
end
@@plugins = items.dup
end
|
.redis_url ⇒ Object
22
23
24
|
# File 'lib/active_tracker/configuration.rb', line 22
def self.redis_url
@@redis_url ||= "redis://localhost:6379/15"
end
|
.redis_url=(url) ⇒ Object
26
27
28
29
30
31
|
# File 'lib/active_tracker/configuration.rb', line 26
def self.redis_url=(url)
unless url.start_with?("redis://")
raise PluginInvalidError.new("redis_url isn't a valid Redis URL - should begin with redis://")
end
@@redis_url = url
end
|
.root_path ⇒ Object
37
38
39
|
# File 'lib/active_tracker/configuration.rb', line 37
def self.root_path
"/#{mountpoint}"
end
|