Sha256: 93a3ee91c916cbc516cb9954a1f6cdeb9c49af456e61792f690831d91027a38b
Contents?: true
Size: 547 Bytes
Versions: 11
Compression:
Stored size: 547 Bytes
Contents
module RakeFactory module Arguments def initialize(*args, &configuration_block) arity = self.method(:initialize).super_method.arity super(*args.slice(0, arity), &configuration_block) process_arguments(args) end def process_arguments(args) opts = args.first || {} opts.each { |key, value| set_if_value_present(key, value) } end private def set_if_value_present(key, value) if self.respond_to?("#{key}=") && !value.nil? self.send("#{key}=", value) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems