class Esbit::Campfire

Attributes

connection[R]
subdomain[R]
token[R]

Public Class Methods

new(subdomain, token) click to toggle source
# File lib/esbit/campfire.rb, line 5
def initialize(subdomain, token)
  @subdomain = subdomain
  @token = token
  @connection = Esbit::Connection.new(self)
end

Public Instance Methods

find_room_by_id(room_id) click to toggle source
# File lib/esbit/campfire.rb, line 21
def find_room_by_id(room_id)
  self.rooms.find { |room| room.id == room_id }
end
find_room_by_name(room_name) click to toggle source
# File lib/esbit/campfire.rb, line 25
def find_room_by_name(room_name)
  self.rooms.find { |room| room.name == room_name }
end
room(room_id) click to toggle source
# File lib/esbit/campfire.rb, line 17
def room(room_id)
  @connection.get 'rooms', id: room_id
end
rooms() click to toggle source
# File lib/esbit/campfire.rb, line 11
def rooms
  @rooms ||= @connection.get('rooms')['rooms'].collect { |room_json|
    Room.new(room_json, @connection)
  }
end