Class: Dramaturg::Prompter::Base
- Inherits:
-
Object
- Object
- Dramaturg::Prompter::Base
- Defined in:
- lib/dramaturg/prompter/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#script ⇒ Object
readonly
Returns the value of attribute script.
Instance Method Summary collapse
- #abort! ⇒ Object
- #call(cmd) ⇒ Object
-
#initialize(script, config) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(script, config) ⇒ Base
6 7 8 9 10 11 12 |
# File 'lib/dramaturg/prompter/base.rb', line 6 def initialize(script,config) @script = script @prompt = config[:prompt] @formatters = config[:format] @current_command = nil end |
Instance Attribute Details
#script ⇒ Object (readonly)
Returns the value of attribute script.
4 5 6 |
# File 'lib/dramaturg/prompter/base.rb', line 4 def script @script end |
Instance Method Details
#abort! ⇒ Object
24 25 26 27 |
# File 'lib/dramaturg/prompter/base.rb', line 24 def abort! @current_command.skip return false end |
#call(cmd) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/dramaturg/prompter/base.rb', line 14 def call(cmd) @current_command = cmd value_map = prepare_values(cmd) display = format_for_display(value_map) results = doIO(display, value_map) process_results(results, value_map) end |