lib/puppet/file_serving/base.rb in puppet-2.7.26 vs lib/puppet/file_serving/base.rb in puppet-3.0.0.rc4
- old
+ new
@@ -1,11 +1,14 @@
require 'puppet/file_serving'
require 'puppet/util'
+require 'puppet/util/methodhelper'
# The base class for Content and Metadata; provides common
# functionality like the behaviour around links.
class Puppet::FileServing::Base
+ include Puppet::Util::MethodHelper
+
# This is for external consumers to store the source that was used
# to retrieve the metadata.
attr_accessor :source
# Does our file exist?
@@ -26,17 +29,10 @@
end
def initialize(path, options = {})
self.path = path
@links = :manage
-
- options.each do |param, value|
- begin
- send param.to_s + "=", value
- rescue NoMethodError
- raise ArgumentError, "Invalid option #{param} for #{self.class}"
- end
- end
+ set_options(options)
end
# Determine how we deal with links.
attr_reader :links
def links=(value)