Class: DTK::Network::Client::Command::RemoveFromGroup

Inherits:
DTK::Network::Client::Command show all
Defined in:
lib/client/command/remove_from_group.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DTK::Network::Client::Command

wrap_command

Methods included from RestWrapper

#rest_delete, #rest_get, #rest_post

Methods included from Client::PermissionsUtil

#validate_permissions!

Methods included from Util::Tar

#gzip, #tar, #ungzip, #untar

Constructor Details

#initialize(group, user, options = {}) ⇒ RemoveFromGroup

Returns a new instance of RemoveFromGroup.



4
5
6
7
# File 'lib/client/command/remove_from_group.rb', line 4

def initialize(group, user, options = {})
  @group = group
  @user      = user
end

Class Method Details

.run(group, user, opts = {}) ⇒ Object



9
10
11
# File 'lib/client/command/remove_from_group.rb', line 9

def self.run(group, user, opts = {})
  new(group, user, opts).revoke_access
end

Instance Method Details

#revoke_accessObject



13
14
15
16
# File 'lib/client/command/remove_from_group.rb', line 13

def revoke_access
  rest_post("groups/#{@group}/remove_member", { name: @group, username: @user })
  nil
end