From 64c1aa411c38a3f08cd4f33f198b36c6badb7067 Mon Sep 17 00:00:00 2001 From: Jaiden Mispy <^_^@mispy.me> Date: Fri, 12 Dec 2014 22:53:19 +1100 Subject: [PATCH] Add default delay range, configure check --- lib/twitter_ebooks/bot.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/twitter_ebooks/bot.rb b/lib/twitter_ebooks/bot.rb index ff39d83..7b63c06 100644 --- a/lib/twitter_ebooks/bot.rb +++ b/lib/twitter_ebooks/bot.rb @@ -180,12 +180,17 @@ module Ebooks @seen_tweets ||= {} @username = username + @delay_range ||= 1..6 configure b.call(self) unless b.nil? Bot.all << self end + def configure + raise ConfigurationError, "Please override the 'configure' method for subclasses of Ebooks::Bot." + end + # Find or create the conversation context for this tweet # @param tweet [Twitter::Tweet] # @return [Ebooks::Conversation]