Class: Visitors::Config
- Inherits:
-
Object
show all
- Defined in:
- lib/visitors/config.rb
Defined Under Namespace
Classes: MissingEnvironmentError
Constant Summary
collapse
- DEFAULTS =
{
:redis_namespace => "visitors_#{Visitors.env}",
:redis_connection => {:host => '127.0.0.1'},
:disabled => false
}
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.load ⇒ Object
12
13
14
|
# File 'lib/visitors/config.rb', line 12
def self.load
new.tap { |instance| instance.send(:define_methods_from_yaml) }
end
|
Instance Method Details
#fields ⇒ Object
16
17
18
|
# File 'lib/visitors/config.rb', line 16
def fields
yaml['fields'] && Array(yaml['fields']).map(&:to_sym)
end
|
#inspect ⇒ Object
25
26
27
|
# File 'lib/visitors/config.rb', line 25
def inspect
all.inspect
end
|