Module: TimePilot
- Defined in:
- lib/time_pilot/web.rb,
lib/time_pilot/version.rb,
lib/time_pilot/time_pilot.rb,
lib/time_pilot/configuration.rb
Defined Under Namespace
Modules: Features
Classes: Configuration, Web
Constant Summary
collapse
- VERSION =
'0.1.1'
- NAMESPACE =
'timepilot'
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.group_classes ⇒ Object
Returns the value of attribute group_classes.
13
14
15
|
# File 'lib/time_pilot/time_pilot.rb', line 13
def group_classes
@group_classes
end
|
Class Method Details
16
17
18
19
20
|
# File 'lib/time_pilot/time_pilot.rb', line 16
def self.configure
@config ||= Configuration.new
yield @config
@config.features.each { |f| define_feature_method(f) }
end
|
.define_feature_method(feature_name) ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/time_pilot/time_pilot.rb', line 22
def self.define_feature_method(feature_name)
Features.module_eval do
define_method "enable_#{feature_name}" do
pilot_enable_feature(feature_name)
end
define_method "disable_#{feature_name}" do
pilot_disable_feature(feature_name)
end
define_method "#{feature_name}_enabled?" do
pilot_feature_enabled?(feature_name)
end
end
end
|
.features ⇒ Object
38
39
40
|
# File 'lib/time_pilot/time_pilot.rb', line 38
def self.features
@config.features
end
|
.key(name) ⇒ Object
46
47
48
|
# File 'lib/time_pilot/time_pilot.rb', line 46
def self.key(name)
"#{NAMESPACE}:#{name}"
end
|
.redis ⇒ Object
42
43
44
|
# File 'lib/time_pilot/time_pilot.rb', line 42
def self.redis
@config.redis_store
end
|
.register_class(klass) ⇒ Object
6
7
8
9
10
|
# File 'lib/time_pilot/time_pilot.rb', line 6
def self.register_class(klass)
@mutex.synchronize do
@group_classes << klass
end
end
|