Module: Settings::SingletonMethods
- Defined in:
- lib/zen/package/settings/lib/settings/singleton_methods.rb
Overview
Module that's injected into the global namespace allowing developers to retrieve settings without having to use the full namespace of Settings::Setting::REGISTERED.
Instance Method Summary (collapse)
-
- (Settings::Setting) get_setting(name)
Retrieves the setting for the given name.
Instance Method Details
- (Settings::Setting) get_setting(name)
Retrieves the setting for the given name. This method returns an instance
of Settings::Setting, this means that in order to retrieve the actual
value you'll have to invoke #value() on the return value.
25 26 27 28 29 30 31 32 33 |
# File 'lib/zen/package/settings/lib/settings/singleton_methods.rb', line 25 def get_setting(name) name = name.to_sym if !Settings::Setting::REGISTERED.key?(name) raise(ArgumentError, "The setting \"#{name}\" doesn't exist.") end return Settings::Setting::REGISTERED[name] end |