summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-08-27 11:28:57 -0700
committerdanielsdeleo <dan@opscode.com>2013-08-27 11:28:57 -0700
commit4db59e6c122d55445426bc3569da1581fbc63fb3 (patch)
tree87943e2f5479a1028e5f72edc353e63acd965259
parentbf68670f01f2e91f1967dea241c3f9018a22aefd (diff)
downloadmixlib-config-methods-uber-alles.tar.gz
Update hash reference to avoid private sendsmethods-uber-alles
-rw-r--r--lib/mixlib/config.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/mixlib/config.rb b/lib/mixlib/config.rb
index 2b5bc1c..f184795 100644
--- a/lib/mixlib/config.rb
+++ b/lib/mixlib/config.rb
@@ -39,12 +39,12 @@ module Mixlib
self.instance_eval(IO.read(filename), filename, 1)
end
- # Pass Mixlib::Config.configure() a block, and it will yield self.configuration.
+ # Pass Mixlib::Config.configure() a block, and it will yield itself
#
# === Parameters
- # <block>:: A block that is sent self.configuration as its argument
+ # <block>:: A block that is called with self as the arugment.
def configure(&block)
- block.call(self.configuration)
+ block.call(self)
end
# Get the value of a configuration option
@@ -58,7 +58,12 @@ module Mixlib
# === Raises
# <ArgumentError>:: If the configuration option does not exist
def [](config_option)
- self.configuration[config_option.to_sym]
+ config_option = config_option.to_sym
+ if private_method_defined?(config_option)
+ nil
+ else
+ send(config_option.to_sym)
+ end
end
# Set the value of a configuration option