Class: Somemoji::CommandBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/somemoji/command_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ CommandBuilder

Returns a new instance of CommandBuilder.

Parameters:

  • argv (Array<String>)


4
5
6
# File 'lib/somemoji/command_builder.rb', line 4

def initialize(argv)
  @argv = argv
end

Instance Method Details

#buildSomemoji::Commands::BaseCommand



9
10
11
12
13
14
15
# File 'lib/somemoji/command_builder.rb', line 9

def build
  if command_line_arguments.valid?
    ::Somemoji::Commands::ExtractCommand.new(command_line_arguments)
  else
    ::Somemoji::Commands::ErrorCommand.new(command_line_arguments)
  end
end