Sha256: 915d6bf702fb2d4eccd8da957238a25759eb27b88a4f2230adb9c7440cda438f

Contents?: true

Size: 783 Bytes

Versions: 1

Compression:

Stored size: 783 Bytes

Contents

require 'mdma/room'

# Provides a method to listen and respond to messages in a Campfire room.
module Mdma
  # Listen and respond to messages in a Campfire room.
  #
  # @example Interact in the room https://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 https://github.com/37signals/campfire-api for Campfire API documentation
  def self.run(options = {})
    Room.new(options).listen do |room, request|
      room.respond_with request.response if request.relevant?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mdma-0.1.1 lib/mdma.rb