lib/bot/adapters/base.rb in bot-0.0.23 vs lib/bot/adapters/base.rb in bot-0.0.26
- old
+ new
@@ -1,14 +1,16 @@
module Bot
module Adapter
class Base
- attr_reader :config
+ def initialize(config={}, &block)
+ @config = lambda { |u| config.merge(block ? block.call(u) : {}) }
+ end
- def initialize(config={})
- @config = config
+ def config(username=nil)
+ @config.call(username)
end
- def send_messages(messages)
+ def send_messages(messages, from)
raise NotImplementedError
end
end
end
end