Class: OpenfireApiRuby::UserService

Inherits:
Object
  • Object
show all
Defined in:
lib/openfire_api_ruby/user_service.rb

Defined Under Namespace

Classes: HTTPException, IllegalArgumentException, InvalidResponseException, RequestNotAuthorisedException, UserAlreadyExistsException, UserNotFoundException, UserServiceDisabledException

Constant Summary collapse

@@api_path =
"plugins/userService/userservice"
@@api_exceptions =
%w(UserServiceDisabled RequestNotAuthorised IllegalArgumentException UserNotFoundException UserAlreadyExistsException)

Instance Method Summary collapse

Constructor Details

#initialize(options = Hash.new) ⇒ UserService

Returns a new instance of UserService.



14
15
16
# File 'lib/openfire_api_ruby/user_service.rb', line 14

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

Instance Method Details

#add_user!(opts) ⇒ Object



18
19
20
# File 'lib/openfire_api_ruby/user_service.rb', line 18

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

#delete_user!(opts) ⇒ Object



22
23
24
# File 'lib/openfire_api_ruby/user_service.rb', line 22

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

#lock_user!(opts) ⇒ Object



30
31
32
# File 'lib/openfire_api_ruby/user_service.rb', line 30

def lock_user!(opts)
  submit_request(opts.merge(:type => :disable))
end

#unlock_user!(opts) ⇒ Object



34
35
36
# File 'lib/openfire_api_ruby/user_service.rb', line 34

def unlock_user!(opts)
  submit_request(opts.merge(:type => :enable))
end

#update_user!(opts) ⇒ Object



26
27
28
# File 'lib/openfire_api_ruby/user_service.rb', line 26

def update_user!(opts)
  submit_request(opts.merge(:type => :update))
end