Skip to content

Commit

Permalink
Fix can register a Class
Browse files Browse the repository at this point in the history
  • Loading branch information
hallelujah committed Jan 2, 2012
1 parent 3fab9d9 commit 04baad7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/rails-excel.rb
Expand Up @@ -13,7 +13,11 @@ class << self
attr_reader :available_strategies

def add_strategy(name, instance)
@available_strategies[name.to_sym] = instance
strategy = instance
if Class === instance && !instance.respond_to?(:compile)
strategy = instance.new
end
@available_strategies[name.to_sym] = strategy
end

def configure(&block)
Expand Down

0 comments on commit 04baad7

Please sign in to comment.