Class: DTK::Network::Client::Command::Unpublish

Inherits:
DTK::Network::Client::Command show all
Defined in:
lib/client/command/unpublish.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(module_ref, options = {}) ⇒ Unpublish

Returns a new instance of Unpublish.



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

def initialize(module_ref, options = {})
  @module_ref       = module_ref
  @options          = options
end

Class Method Details

.run(module_info, opts = {}) ⇒ Object



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

def self.run(module_info, opts = {})
  module_ref      = ModuleRef.new(module_info)
  new(module_ref, opts).unpublish
end

Instance Method Details

#unpublishObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/client/command/unpublish.rb', line 14

def unpublish
  version = @module_ref.version
  params = {
    name: @module_ref.name,
    namespace: @module_ref.namespace,
    version: version.str_version
  }
  rest_post("modules/unpublish", params)

  nil
end