Class: SnippetCli::WizardContext
- Inherits:
-
Data
- Object
- Data
- SnippetCli::WizardContext
- Defined in:
- lib/snippet_cli/wizard_context.rb
Overview
Carries shared wizard configuration: which file to save to, which global var names are already declared in that file, and the pipe IO for structured output when stdout is redirected. Passed explicitly rather than communicated via global state.
Instance Attribute Summary collapse
-
#global_var_names ⇒ Object
readonly
Returns the value of attribute global_var_names.
-
#pipe_output ⇒ Object
readonly
Returns the value of attribute pipe_output.
-
#save_path ⇒ Object
readonly
Returns the value of attribute save_path.
Instance Method Summary collapse
-
#initialize(global_var_names: [], save_path: nil, pipe_output: nil) ⇒ WizardContext
constructor
A new instance of WizardContext.
Constructor Details
#initialize(global_var_names: [], save_path: nil, pipe_output: nil) ⇒ WizardContext
Returns a new instance of WizardContext.
9 10 11 |
# File 'lib/snippet_cli/wizard_context.rb', line 9 def initialize(global_var_names: [], save_path: nil, pipe_output: nil) super end |
Instance Attribute Details
#global_var_names ⇒ Object (readonly)
Returns the value of attribute global_var_names
8 9 10 |
# File 'lib/snippet_cli/wizard_context.rb', line 8 def global_var_names @global_var_names end |
#pipe_output ⇒ Object (readonly)
Returns the value of attribute pipe_output
8 9 10 |
# File 'lib/snippet_cli/wizard_context.rb', line 8 def pipe_output @pipe_output end |
#save_path ⇒ Object (readonly)
Returns the value of attribute save_path
8 9 10 |
# File 'lib/snippet_cli/wizard_context.rb', line 8 def save_path @save_path end |