Permalink
Browse files

edit the fetcher so the :receiver option can be a String as well as a…

… Class. Fixes a reported bug
  • Loading branch information...
1 parent 2e82e23 commit e30d225b873c204f161b04cce80e136c414a8b06 @look committed Sep 7, 2007
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/fetcher/base.rb
View
@@ -17,6 +17,11 @@ class Base
def initialize(options={})
%w(server username password receiver).each do |opt|
raise ArgumentError, "#{opt} is required" unless options[opt.to_sym]
+ # convert receiver to a Class if it isn't already.
+ if opt == "receiver" && options[:receiver].is_a?(String)
+ options[:receiver] = Kernel.const_get(options[:receiver])
+ end
+
instance_eval("@#{opt} = options[:#{opt}]")
end
end

0 comments on commit e30d225

Please sign in to comment.