9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/uricp/uri_strategy.rb', line 9
def self.choose_strategy(options)
current = options.reject {|k,v| k.is_a? Symbol}
strategy_list = []
while STRATEGIES.detect {|klass| @strategy = klass.new(current).appropriate? }
debug "#{self.name}: Selected strategy #{@strategy.class.name}"
strategy_list << @strategy
current = @strategy.proposed_options
end
raise Uricp::UnsupportedURLtype, "Unsupported transfer from #{options['from_uri']} to #{options['to_uri']}" if incomplete_strategy?(strategy_list)
strategy_list
end
|