lib/junk_drawer/notifier.rb in junk_drawer-1.6.3 vs lib/junk_drawer/notifier.rb in junk_drawer-1.7.0

- old
+ new

@@ -10,27 +10,26 @@ include Callable class << self - attr_accessor :strategy + attr_reader :strategy + def strategy=(strategy) + @strategy = + strategy.is_a?(Symbol) ? STRATEGIES.fetch(strategy) : strategy + end + end STRATEGIES = { honeybadger: HoneybadgerStrategy, raise: RaiseStrategy, null: NullStrategy, }.freeze def call(*args) - strategy.(*args) - end - - private - - def strategy - STRATEGIES.fetch(self.class.strategy) + self.class.strategy.(*args) end end end