Sha256: 0a55c20c5df9c583ae46e92c04df026fcf4926e5608ccc49f7aeec15d84cf691
Contents?: true
Size: 1.35 KB
Versions: 1
Compression:
Stored size: 1.35 KB
Contents
module Lita module Adapters class Campfire < Adapter namespace 'campfire' config :subdomain, type: String, required: true config :apikey, type: String, required: true config :rooms, type: Array, required: true config :debug, type: [TrueClass, FalseClass], default: false config :tinder_options, type: Hash, default: {} attr_reader :connector def initialize(robot) super options = { subdomain: config.subdomain, apikey: config.apikey, rooms: rooms, debug: config.debug, tinder_options: config.tinder_options } @connector = Connector.new( robot, options ) end def run connector.connect connector.join_rooms sleep rescue Interrupt disconnect end def send_messages(target, messages) connector.send_messages(target.room, messages) end def set_topic(target, topic) connector.set_topic(target.room, topic) end def shut_down disconnect end private def config Lita.config.adapters.campfire end def rooms Array(config.rooms) end def disconnect connector.disconnect end end Lita.register_adapter(:campfire, Campfire) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lita-campfire-0.3.0 | lib/lita/adapters/campfire.rb |