Module: Mdma

Defined in:
lib/mdma.rb,
lib/mdma/version.rb

Overview

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

Constant Summary collapse

VERSION =
'0.1.1'

Class Method Summary collapse

Class Method Details

.run(options = {}) ⇒ Object

Listen and respond to messages in a Campfire room.

Examples:

Interact in the room xxx.campfirenow.com/room/123 as the user with token ‘abcd’


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

Parameters:

  • subdomain (String)

    The campfirenow.com subdomain that hosts the room

  • room_id (Integer)

    The ID of the Campfire room

  • token (String)

    The token of the Campfire user to interact with

See Also:



17
18
19
20
21
# 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