lib/thinreports/generator.rb in thinreports-0.8.1 vs lib/thinreports/generator.rb in thinreports-0.8.2

- old
+ new

@@ -5,12 +5,13 @@ module Generator # @param [Symbol] type # @param report (see Thinreports::Generator::Base#initialize) # @param options (see Thinreports::Generator::Base#initialize) def self.new(type, report, options = {}) - unless generator = registry[type] - raise Thinreports::Errors::UnknownGeneratorType.new(type) - end + generator = registry[type] + + raise Thinreports::Errors::UnknownGeneratorType.new(type) unless generator + generator.new(report, options) end def self.register(type, generator) registry[type] = generator