class Daneel::Adapter
Public Class Methods
named(name)
click to toggle source
# 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
Public Instance Methods
announce(message)
click to toggle source
# File lib/daneel/adapter.rb, line 17 def announce(message) # say the message into every room the bot is in end
me()
click to toggle source
# 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
run()
click to toggle source
# File lib/daneel/adapter.rb, line 9 def run # listen to rooms and dispatch messages to robot.receive end
say(room_id, message)
click to toggle source
# File lib/daneel/adapter.rb, line 13 def say(room_id, message) # get the message into the room! end