diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-07 15:53:17 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-07 15:53:17 -0700 |
commit | a35fa519c85a761ac8bed3be8fde2d6523cae474 (patch) | |
tree | 36f3583ee364ba1d68467a2b614a8dfcf9ed43ae /lib/puppet/string/action_builder.rb | |
parent | 3d5ec4f61fee08552767e950ac021752c202a599 (diff) | |
parent | 87ed3188e65d3f5f9c2c32a409b271d1b39684b9 (diff) | |
download | puppet-a35fa519c85a761ac8bed3be8fde2d6523cae474.tar.gz puppet-a35fa519c85a761ac8bed3be8fde2d6523cae474.tar.xz puppet-a35fa519c85a761ac8bed3be8fde2d6523cae474.zip |
Merge branch 'refactor/master/7012-rename-strings-to-interfaces-and-faces'
Diffstat (limited to 'lib/puppet/string/action_builder.rb')
-rw-r--r-- | lib/puppet/string/action_builder.rb | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/puppet/string/action_builder.rb b/lib/puppet/string/action_builder.rb deleted file mode 100644 index e7c03273b..000000000 --- a/lib/puppet/string/action_builder.rb +++ /dev/null @@ -1,31 +0,0 @@ -require 'puppet/string' -require 'puppet/string/action' - -class Puppet::String::ActionBuilder - attr_reader :action - - def self.build(string, name, &block) - raise "Action #{name.inspect} must specify a block" unless block - new(string, name, &block).action - end - - private - def initialize(string, name, &block) - @string = string - @action = Puppet::String::Action.new(string, name) - instance_eval(&block) - end - - # Ideally the method we're defining here would be added to the action, and a - # method on the string would defer to it, but we can't get scope correct, - # so we stick with this. --daniel 2011-03-24 - def when_invoked(&block) - raise "when_invoked on an ActionBuilder with no corresponding Action" unless @action - @action.when_invoked = block - end - - def option(*declaration, &block) - option = Puppet::String::OptionBuilder.build(@action, *declaration, &block) - @action.add_option(option) - end -end |