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