diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-18 13:29:47 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-19 10:53:36 -0700 |
commit | 86801b580101315706b1b02a00a36840eabd75cd (patch) | |
tree | 9d0db179dabc6b113ff63965df0f01a2e2dadeb2 /lib/puppet/interface/option_builder.rb | |
parent | be23b8423ba77a5935586e277bf543cd54b9dec7 (diff) | |
download | puppet-86801b580101315706b1b02a00a36840eabd75cd.tar.gz puppet-86801b580101315706b1b02a00a36840eabd75cd.tar.xz puppet-86801b580101315706b1b02a00a36840eabd75cd.zip |
(#7013) Support 'when_rendering' and 'render_as' in actions.
These define the API used by folks writing actions that supports their
rendering hooks. 'when_rendering' defines a helper method on the interface,
which runs the users code in their expected context.
'render_as' just sets the default rendering format; by default this is
:for_humans.
Reviewed-By: Max Martin <max@puppetlabs.com>
Diffstat (limited to 'lib/puppet/interface/option_builder.rb')
-rw-r--r-- | lib/puppet/interface/option_builder.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/interface/option_builder.rb b/lib/puppet/interface/option_builder.rb index 7c2ab89de..8f358c222 100644 --- a/lib/puppet/interface/option_builder.rb +++ b/lib/puppet/interface/option_builder.rb @@ -20,7 +20,7 @@ class Puppet::Interface::OptionBuilder next if setter =~ /^=/ dsl = setter.sub(/=$/, '') - unless self.class.methods.include?(dsl) + unless private_instance_methods.include? dsl define_method(dsl) do |value| @option.send(setter, value) end end end |