Class: Plz::CommandBuilder
- Inherits:
-
Object
- Object
- Plz::CommandBuilder
- Defined in:
- lib/plz/command_builder.rb
Constant Summary collapse
- SCHEMA_FILE_PATH_PATTERN =
"schema.{json,yml}"
Class Method Summary collapse
-
.call(arguments) ⇒ Plz::Command
Builds callable command object from given ARGV.
Instance Method Summary collapse
-
#call ⇒ Plz::Command
Callable command object.
-
#initialize(argv) ⇒ CommandBuilder
constructor
A new instance of CommandBuilder.
Constructor Details
#initialize(argv) ⇒ CommandBuilder
Returns a new instance of CommandBuilder.
22 23 24 |
# File 'lib/plz/command_builder.rb', line 22 def initialize(argv) @argv = argv end |
Class Method Details
.call(arguments) ⇒ Plz::Command
Builds callable command object from given ARGV
9 10 11 |
# File 'lib/plz/command_builder.rb', line 9 def self.call(arguments) new(arguments).call end |
Instance Method Details
#call ⇒ Plz::Command
Returns Callable command object.
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/plz/command_builder.rb', line 27 def call validate! Command.new( method: method, base_url: base_url, path: path, headers: headers, params: request_params, ) rescue Error => error ErrorCommand.new(error) end |