Class: OpenfireRoomApi::RoomService

Inherits:
Object
  • Object
show all
Defined in:
lib/openfire_room_api/room_service.rb

Defined Under Namespace

Classes: HTTPException, IllegalArgumentException, InvalidResponseException, NotAllowedException, RequestNotAuthorisedException, RoomServiceDisabledException

Constant Summary collapse

@@api_path =
"plugins/roomService/roomservice"
@@api_exceptions =
%w(RoomServiceDisabled RequestNotAuthorised NotAllowedException IllegalArgumentException)

Instance Method Summary collapse

Constructor Details

#initialize(options = Hash.new) ⇒ RoomService

Returns a new instance of RoomService.



13
14
15
# File 'lib/openfire_room_api/room_service.rb', line 13

def initialize(options=Hash.new)
  @options = { :path => @@api_path }.merge(options)
end

Instance Method Details

#add_room!(opts) ⇒ Object



17
18
19
# File 'lib/openfire_room_api/room_service.rb', line 17

def add_room!(opts)
  submit_request(opts.merge(:type => :add))
end

#delete_room!(opts) ⇒ Object



21
22
23
# File 'lib/openfire_room_api/room_service.rb', line 21

def delete_room!(opts)
  submit_request(opts.merge(:type => :delete))
end