Class: Cliqr::Command::CommandContextBuilder Private
- Inherits:
-
Object
- Object
- Cliqr::Command::CommandContextBuilder
- Defined in:
- lib/cliqr/command/command_context.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Builder for creating a instance of CommandContext from parsed cli arguments
Instance Method Summary collapse
-
#build ⇒ Cliqr::Command::CommandContext
private
Build a new instance of CommandContext.
-
#initialize(config, parsed_input, options, executor) ⇒ Cliqr::Command::CommandContextBuilder
constructor
private
Initialize builder for CommandContext.
Constructor Details
#initialize(config, parsed_input, options, executor) ⇒ Cliqr::Command::CommandContextBuilder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize builder for CommandContext
204 205 206 207 208 209 |
# File 'lib/cliqr/command/command_context.rb', line 204 def initialize(config, parsed_input, , executor) @config = config @parsed_input = parsed_input = @executor = executor end |
Instance Method Details
#build ⇒ Cliqr::Command::CommandContext
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Build a new instance of CommandContext
214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/cliqr/command/command_context.rb', line 214 def build option_contexts = @parsed_input..map do |option_name, option_values| CommandOption.new(option_name, option_values, @config.option(option_name)) end CommandContext.new @config, option_contexts, @parsed_input.arguments, [:environment], @executor, build_output_stream() end |