Class: RspecStarter::CommandContext
- Inherits:
-
StepContext
- Object
- StepContext
- RspecStarter::CommandContext
- Defined in:
- lib/rspec_starter/command_context.rb
Overview
CommandContext’s are created to when parsing the RspecStater.start block. They hold the args for Commands. They are asked to create instances of Command from this information when it is time to execute. The also resolve the options that each Command is allowed to access.
Instance Attribute Summary collapse
-
#command_string ⇒ Object
readonly
Returns the value of attribute command_string.
Attributes inherited from StepContext
#environment, #id, #requested_args
Instance Method Summary collapse
-
#initialize(environment:, id:, command_string:, requested_args:) ⇒ CommandContext
constructor
A new instance of CommandContext.
- #instantiate(runner) ⇒ Object
- #is_command? ⇒ Boolean
- #is_task? ⇒ Boolean
- #step_class ⇒ Object
Constructor Details
#initialize(environment:, id:, command_string:, requested_args:) ⇒ CommandContext
Returns a new instance of CommandContext.
8 9 10 11 12 |
# File 'lib/rspec_starter/command_context.rb', line 8 def initialize(environment:, id:, command_string:, requested_args:) super(environment: environment, id: id, requested_args: requested_args) @command_string = command_string end |
Instance Attribute Details
#command_string ⇒ Object (readonly)
Returns the value of attribute command_string.
6 7 8 |
# File 'lib/rspec_starter/command_context.rb', line 6 def command_string @command_string end |
Instance Method Details
#instantiate(runner) ⇒ Object
14 15 16 |
# File 'lib/rspec_starter/command_context.rb', line 14 def instantiate(runner) Command.new(@id, runner, @command_string, ) end |
#is_command? ⇒ Boolean
26 27 28 |
# File 'lib/rspec_starter/command_context.rb', line 26 def is_command? true end |
#is_task? ⇒ Boolean
22 23 24 |
# File 'lib/rspec_starter/command_context.rb', line 22 def is_task? false end |
#step_class ⇒ Object
18 19 20 |
# File 'lib/rspec_starter/command_context.rb', line 18 def step_class Command end |