Class: Class
- Defined in:
- lib/gems/configatron-2.2.2/lib/configatron/core_ext/class.rb
Instance Method Summary collapse
-
#to_configatron ⇒ Object
Returns access to configuration parameters named after the class.
Instance Method Details
#to_configatron ⇒ Object
Returns access to configuration parameters named after the class.
Examples:
configatron.foo. = :bar
configatron.a.b.c.d = 'D'
class Foo
end
module A
module B
class C
end
end
end
Foo.to_configatron. # => :bar
A::B::C.to_configatron.d # => 'D'
21 22 23 24 |
# File 'lib/gems/configatron-2.2.2/lib/configatron/core_ext/class.rb', line 21 def to_configatron name_spaces = self.name.split("::").collect{|s| s.methodize} configatron.send_with_chain(name_spaces) end |