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
185 186 187 188 189 190 |
# File 'lib/cliqr/command/command_context.rb', line 185 def initialize(config, parsed_input, , executor) @config = config @parsed_input = parsed_input @options = @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
195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/cliqr/command/command_context.rb', line 195 def build option_contexts = @parsed_input..map do |option| CommandOption.new(option, @config.option(option.first)) end CommandContext.new @config, option_contexts, @parsed_input.arguments, @options[:environment], @executor end |