lib/weeter/runner.rb in weeter-0.9.2 vs lib/weeter/runner.rb in weeter-0.10.0

- old
+ new

@@ -22,19 +22,30 @@ end } end protected - + + def limiter + @limiter ||= if @config.limiter.enabled + Weeter::Limitator.new({ + max: @config.limiter.max, + duration: @config.limiter.duration + }) + else + Weeter::Limitator::UNLIMITED + end + end + def notification_plugin @notification_plugin ||= Weeter::Plugins::NotificationPlugin.new(@config.client_app) end def subscription_plugin @subscription_plugin ||= Weeter::Plugins::SubscriptionPlugin.new(@config.client_app) end def tweet_consumer - @tweet_consumer ||= Weeter::Twitter::TweetConsumer.new(@config.twitter, notification_plugin) + @tweet_consumer ||= Weeter::Twitter::TweetConsumer.new(@config.twitter, notification_plugin, limiter) end end end