Class: Daneel::Adapter

Inherits:
Plugin
  • Object
show all
Defined in:
lib/daneel/adapter.rb

Instance Attribute Summary

Attributes inherited from Plugin

#robot

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Plugin

#initialize, #logger, requires_env

Constructor Details

This class inherits a constructor from Daneel::Plugin

Class Method Details

.named(name) ⇒ Object



29
30
31
32
33
# File 'lib/daneel/adapter.rb', line 29

def named(name)
  require File.join('daneel/adapters', name.downcase)
  adapter = Daneel::Adapters.const_get(name.capitalize)
  adapter || raise("Couldn't find Daneel::Adapters::#{a.capitalize}")
end

Instance Method Details

#announce(message) ⇒ Object



17
18
19
# File 'lib/daneel/adapter.rb', line 17

def announce(message)
  # say the message into every room the bot is in
end

#meObject



21
22
23
24
25
26
# File 'lib/daneel/adapter.rb', line 21

def me
  @me ||= User.new(0, "R. Daneel Olivaw").tap do |me|
    me.short_name = "Daneel"
    me.initials = "DO"
  end
end

#runObject



9
10
11
# File 'lib/daneel/adapter.rb', line 9

def run
  # listen to rooms and dispatch messages to robot.receive
end

#say(room_id, message) ⇒ Object



13
14
15
# File 'lib/daneel/adapter.rb', line 13

def say(room_id, message)
  # get the message into the room!
end