Class: DTK::Network::Client::Command::AddToGroup

Inherits:
DTK::Network::Client::Command show all
Defined in:
lib/client/command/add_to_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 = {}) ⇒ AddToGroup

Returns a new instance of AddToGroup.



4
5
6
7
# File 'lib/client/command/add_to_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/add_to_group.rb', line 9

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

Instance Method Details

#add_to_groupObject



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

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