/tools/Ruby/lib/ruby/gems/1.8/gems/configatron-2.8.2/lib/configatron/core_ext/class.rb
http://github.com/agross/netopenspace · Ruby · 25 lines · 5 code · 2 blank · 18 comment · 0 complexity · 9cfc48720b70bc8d10d481665945ec54 MD5 · raw file
- class Class
-
- # Returns access to configuration parameters named after the class.
- #
- # Examples:
- # configatron.foo.bar = :bar
- # configatron.a.b.c.d = 'D'
- #
- # class Foo
- # end
- #
- # module A
- # module B
- # class C
- # end
- # end
- # end
- #
- # Foo.to_configatron.bar # => :bar
- # A::B::C.to_configatron.d # => 'D'
- def to_configatron(*args)
- self.name.to_configatron(*args)
- end
-
- end