diff options
Diffstat (limited to 'lib/puppet/string/option_builder.rb')
-rw-r--r-- | lib/puppet/string/option_builder.rb | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/puppet/string/option_builder.rb b/lib/puppet/string/option_builder.rb deleted file mode 100644 index da0d213fb..000000000 --- a/lib/puppet/string/option_builder.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'puppet/string/option' - -class Puppet::String::OptionBuilder - attr_reader :option - - def self.build(string, *declaration, &block) - new(string, *declaration, &block).option - end - - private - def initialize(string, *declaration, &block) - @string = string - @option = Puppet::String::Option.new(string, *declaration) - block and instance_eval(&block) - @option - end - - # Metaprogram the simple DSL from the option class. - Puppet::String::Option.instance_methods.grep(/=$/).each do |setter| - next if setter =~ /^=/ # special case, darn it... - - dsl = setter.sub(/=$/, '') - define_method(dsl) do |value| @option.send(setter, value) end - end -end |