Class: DTK::Network::Client::Command::Info
Class Method Summary
collapse
Instance Method Summary
collapse
wrap_command
#rest_delete, #rest_get, #rest_post
#validate_permissions!
Methods included from Util::Tar
#gzip, #tar, #ungzip, #untar
Constructor Details
#initialize(module_ref, options = {}) ⇒ Info
Returns a new instance of Info.
4
5
6
7
|
# File 'lib/client/command/info.rb', line 4
def initialize(module_ref, options = {})
@module_ref = module_ref
@about = options[:about] || :versions
end
|
Class Method Details
.run(module_info, opts = {}) ⇒ Object
9
10
11
12
|
# File 'lib/client/command/info.rb', line 9
def self.run(module_info, opts = {})
module_ref = ModuleRef.new(module_info)
new(module_ref, opts).info
end
|
Instance Method Details
#info ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/client/command/info.rb', line 14
def info
case @about.to_sym
when :versions
versions
else
module_info
end
end
|
#module_info ⇒ Object
28
29
|
# File 'lib/client/command/info.rb', line 28
def module_info
end
|
#versions ⇒ Object
23
24
25
26
|
# File 'lib/client/command/info.rb', line 23
def versions
modules_info = rest_get('modules/get_versions', { name: @module_ref.name, namespace: @module_ref.namespace })
modules_info['versions'] || []
end
|