lib/sidekiq/throttled/web/stats.rb in sidekiq-throttled-0.11.0 vs lib/sidekiq/throttled/web/stats.rb in sidekiq-throttled-0.12.0

- old
+ new

@@ -12,25 +12,21 @@ [1, "second", "seconds"] ].freeze # @param [Strategy::Concurrency, Strategy::Threshold] strategy def initialize(strategy) - if strategy&.dynamic? - raise ArgumentError, "Can't handle dynamic strategies" - end + raise ArgumentError, "Can't handle dynamic strategies" if strategy&.dynamic? @strategy = strategy end # @return [String] def to_html return "" unless @strategy html = humanize_integer(@strategy.limit) << " jobs" - if @strategy.respond_to? :period - html << " per " << humanize_duration(@strategy.period) - end + html << " per " << humanize_duration(@strategy.period) if @strategy.respond_to?(:period) html << "<br />" << colorize_count(@strategy.count, @strategy.limit) end private