Skip to content

Commit

Permalink
Adding support for directly passing an Output::Base subclass to Contr…
Browse files Browse the repository at this point in the history
…oller::build(). The documentation suggested you could do this, but it meant that you could anything in the Output namespace. This change really allows you to pass a Class directly.
  • Loading branch information
JEG2 committed Sep 28, 2009
1 parent f893da1 commit 19d3e3c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/request_log_analyzer/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ def self.build(options)
# Set the output class
output_args = {}
output_object = nil
output_class = RequestLogAnalyzer::Output::const_get(options[:output])
if options[:output].is_a? Class
output_class = options[:output]
else
output_class = RequestLogAnalyzer::Output::const_get(options[:output])
end

output_sort = options[:report_sort].split(',').map { |s| s.to_sym }
output_amount = options[:report_amount] == 'all' ? :all : options[:report_amount].to_i
Expand Down

0 comments on commit 19d3e3c

Please sign in to comment.