Class: DuoSplitter::Commands::BaseCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/duo_splitter/commands/base_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ BaseCommand

Returns a new instance of BaseCommand.



11
12
13
14
15
16
17
18
# File 'lib/duo_splitter/commands/base_command.rb', line 11

def initialize(argv)
  @parser = OptionParser.new
  @context = Context.new
  @context.output_dir = default_output_dir if default_output_dir

  parse_options(argv)
  handle_audio_paths(argv)
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



9
10
11
# File 'lib/duo_splitter/commands/base_command.rb', line 9

def context
  @context
end

#parserObject (readonly)

Returns the value of attribute parser.



9
10
11
# File 'lib/duo_splitter/commands/base_command.rb', line 9

def parser
  @parser
end

Instance Method Details

#runObject

Raises:



20
21
22
# File 'lib/duo_splitter/commands/base_command.rb', line 20

def run
  raise Error, '#run must be defined in sub classes'
end