Skip to content
This repository has been archived by the owner on Dec 2, 2017. It is now read-only.

Commit

Permalink
edit the fetcher so the :receiver option can be a String as well as a…
Browse files Browse the repository at this point in the history
… Class. Fixes a reported bug
  • Loading branch information
look committed Sep 7, 2007
1 parent 2e82e23 commit e30d225
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/fetcher/base.rb
Expand Up @@ -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
Expand Down

0 comments on commit e30d225

Please sign in to comment.