Class: Qbot::Adapter::Driver
- Inherits:
-
Object
- Object
- Qbot::Adapter::Driver
- Defined in:
- lib/qbot/adapter.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #listen(&block) ⇒ Object
- #post(text, **options) ⇒ Object
- #reply_to(message, text, **options) ⇒ Object
- #run(bots) ⇒ Object
Class Method Details
.build ⇒ Object
15 16 17 |
# File 'lib/qbot/adapter.rb', line 15 def build @target.new end |
.inherited(subclass) ⇒ Object
11 12 13 |
# File 'lib/qbot/adapter.rb', line 11 def inherited(subclass) @target = subclass end |
Instance Method Details
#listen(&block) ⇒ Object
27 28 29 |
# File 'lib/qbot/adapter.rb', line 27 def listen(&block) raise 'Not implemented' end |
#post(text, **options) ⇒ Object
31 32 33 |
# File 'lib/qbot/adapter.rb', line 31 def post(text, **) raise 'Not implemented' end |
#reply_to(message, text, **options) ⇒ Object
35 36 37 |
# File 'lib/qbot/adapter.rb', line 35 def reply_to(, text, **) raise 'Not implemented' end |
#run(bots) ⇒ Object
21 22 23 24 25 |
# File 'lib/qbot/adapter.rb', line 21 def run(bots) listen do || bots.each { |bot| bot.call(.dup) } end end |