Class: Vnehm::DlCommand

Inherits:
Command show all
Defined in:
lib/vnehm/commands/dl_command.rb

Instance Attribute Summary

Attributes inherited from Command

#options, #options_descs

Instance Method Summary collapse

Methods inherited from Command

#add_option, #handle_options, #invoke

Constructor Details

#initializeDlCommand

Returns a new instance of DlCommand.



4
5
6
7
8
9
# File 'lib/vnehm/commands/dl_command.rb', line 4

def initialize
  super

  add_option(:to, 'to ПУТЬ',
             'Скачать аудиозапись(и) в ПУТЬ')
end

Instance Method Details

#argumentsObject



19
20
21
# File 'lib/vnehm/commands/dl_command.rb', line 19

def arguments
  { 'ЧИСЛО' => '(Необязательно) Скачать последние ЧИСЛО Ваших аудиозаписей' }
end

#executeObject



11
12
13
14
15
16
17
# File 'lib/vnehm/commands/dl_command.rb', line 11

def execute
  @options[:dl] = 'yes'

  get_cmd = CommandManager.command_instance('get')
  get_cmd.options = @options
  get_cmd.execute
end

#program_nameObject



23
24
25
# File 'lib/vnehm/commands/dl_command.rb', line 23

def program_name
  'vnehm dl'
end

#summaryObject



27
28
29
# File 'lib/vnehm/commands/dl_command.rb', line 27

def summary
  'Загрузка Ваших аудиозаписей из VK'
end

#usageObject



31
32
33
# File 'lib/vnehm/commands/dl_command.rb', line 31

def usage
  "#{program_name} [ЧИСЛО] [ОПЦИИ]"
end