Class: Slice::CommandBuilder
- Inherits:
-
Object
- Object
- Slice::CommandBuilder
- Defined in:
- lib/slice/command_builder.rb
Instance Method Summary collapse
-
#call ⇒ Object
Slice::CommandBuilder#call Returns a new instance of command class that inherits from Slice::Commands::Base.
-
#initialize(argv) ⇒ CommandBuilder
constructor
Slice::CommandBuilder.new(argv) Creates a new instance of Slice::CommandBuilder from the given command line arguments.
Constructor Details
#initialize(argv) ⇒ CommandBuilder
Slice::CommandBuilder.new(argv) Creates a new instance of Slice::CommandBuilder from the given command line arguments.
14 15 16 |
# File 'lib/slice/command_builder.rb', line 14 def initialize(argv) @argv = argv end |
Instance Method Details
#call ⇒ Object
Slice::CommandBuilder#call Returns a new instance of command class that inherits from Slice::Commands::Base.
21 22 23 24 25 26 27 |
# File 'lib/slice/command_builder.rb', line 21 def call if arguments.valid? Slice::Commands::Request.new(arguments) else Slice::Commands::Error.new(arguments) end end |