Module: Nico

Defined in:
lib/nico.rb,
lib/nico/room.rb,
lib/nico/aliases.rb,
lib/nico/message.rb,
lib/nico/version.rb,
lib/nico/room/listener.rb,
lib/nico/room/responder.rb,
lib/nico/matchers/daft_punk_matcher.rb

Overview

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

Defined Under Namespace

Modules: Matchers Classes: Listener, Message, Responder, Room

Constant Summary collapse

ALIASES =
['Nico', 'Foghorn', 'Computer', 'Hey']
VERSION =
'0.0.2'

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 'nico'
Nico.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/nico.rb', line 17

def self.run(options = {})
  Room.new(options).listen do |room, request|
    room.respond_with request.response if request.relevant?
  end
end