Class: Command::RecordingInterpreter
- Inherits:
-
TextInterpreter
- Object
- BaseInterpreter
- TextInterpreter
- Command::RecordingInterpreter
- Defined in:
- lib/command-set/interpreter/recording.rb
Defined Under Namespace
Classes: Complete, Event, Execute
Instance Attribute Summary
Attributes inherited from TextInterpreter
Attributes inherited from BaseInterpreter
#command_set, #logger, #out_io, #sub_modes, #subject
Instance Method Summary collapse
- #dump_to(io) ⇒ Object
- #get_formatters ⇒ Object
-
#initialize(file, mod) ⇒ RecordingInterpreter
constructor
A new instance of RecordingInterpreter.
- #process_line(line) ⇒ Object
- #readline_complete(buffer, prefix) ⇒ Object
Methods inherited from TextInterpreter
#complete, #cook_input, #get_prompt, #go, #output_exception, #pause_before_dying, #prompt_user, #split_line, #stop
Methods inherited from BaseInterpreter
#behavior, #fill_subject, #get_formatter, #get_subject, #next_command, #pop_mode, #prep_subject, #process_input, #prompt_user, #push_mode, #subject_requirements
Constructor Details
#initialize(file, mod) ⇒ RecordingInterpreter
Returns a new instance of RecordingInterpreter.
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/command-set/interpreter/recording.rb', line 62 def initialize(file, mod) @events = [] @current_hash_array = nil @set_path = File::(file) @module_name = mod super() self.command_set = CommandSet::define_commands do require_commands(mod, file) end end |
Instance Method Details
#dump_to(io) ⇒ Object
91 92 93 94 95 96 97 98 |
# File 'lib/command-set/interpreter/recording.rb', line 91 def dump_to(io) setup = { 'events' => @events, 'set_path' => @set_path, 'module_name' => @module_name } io.write(YAML::dump(setup)) end |
#get_formatters ⇒ Object
86 87 88 89 |
# File 'lib/command-set/interpreter/recording.rb', line 86 def get_formatters @current_hasharray = Results::HashArrayFormatter.new return [get_formatter, @current_hasharray] end |