Module: Paddock
- Defined in:
- lib/paddock.rb
Defined Under Namespace
Classes: Feature, FeatureNotFound
Class Method Summary
collapse
Class Method Details
.disable(name, options = {}) ⇒ Object
51
52
53
|
# File 'lib/paddock.rb', line 51
def self.disable(name, options={})
Paddock::Feature.add(name, (options[:in] || :all), :disabled)
end
|
.enable(name, options = {}) ⇒ Object
47
48
49
|
# File 'lib/paddock.rb', line 47
def self.enable(name, options={})
Paddock::Feature.add(name, (options[:in] || :all))
end
|
.enabled(name) ⇒ Object
55
56
57
58
59
|
# File 'lib/paddock.rb', line 55
def enabled(name)
enabled = Paddock::Feature.get(name).enabled?
enabled && yield if block_given?
enabled
end
|
.enabled? ⇒ Object
60
61
62
63
64
|
# File 'lib/paddock.rb', line 60
def enabled(name)
enabled = Paddock::Feature.get(name).enabled?
enabled && yield if block_given?
enabled
end
|
.environment ⇒ Object
30
31
32
|
# File 'lib/paddock.rb', line 30
def self.environment
@environment
end
|
.environment=(env) ⇒ Object
26
27
28
|
# File 'lib/paddock.rb', line 26
def self.environment=(env)
@environment = env
end
|
.features(&block) ⇒ Object
34
35
36
37
|
# File 'lib/paddock.rb', line 34
def self.features(&block)
@block = block
instance_eval(&block)
end
|
.reset! ⇒ Object
39
40
41
42
43
44
45
|
# File 'lib/paddock.rb', line 39
def self.reset!
if block = @block
features(&block)
else
raise "No paddock block defined!"
end
end
|