module Mdma

Provides a method to listen and respond to messages in a Campfire room.

Constants

VERSION

Public Class Methods

run(options = {}) click to toggle source

Listen and respond to messages in a Campfire room.

@example Interact in the room xxx.campfirenow.com/room/123 as the user with token 'abcd'

require 'mdma'
Mdma.run 'xxx', 123, 'abcd'

@param [String] subdomain The campfirenow.com subdomain that hosts the room @param [Integer] room_id The ID of the Campfire room @param [String] token The token of the Campfire user to interact with

@see github.com/37signals/campfire-api for Campfire API documentation

# File lib/mdma.rb, line 17
def self.run(options = {})
  Room.new(options).listen do |room, request|
    room.respond_with request.response if request.relevant?
  end
end