Class: Appydave::Tools::GptContext::OutputHandler
- Inherits:
-
Object
- Object
- Appydave::Tools::GptContext::OutputHandler
- Defined in:
- lib/appydave/tools/gpt_context/output_handler.rb
Overview
OutputHandler is responsible for writing the output to the desired target
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(content, options) ⇒ OutputHandler
constructor
A new instance of OutputHandler.
Constructor Details
#initialize(content, options) ⇒ OutputHandler
Returns a new instance of OutputHandler.
8 9 10 11 12 |
# File 'lib/appydave/tools/gpt_context/output_handler.rb', line 8 def initialize(content, ) @content = content @output_targets = .output_target @working_directory = .working_directory end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/appydave/tools/gpt_context/output_handler.rb', line 14 def execute @output_targets.each do |target| case target when 'clipboard' Clipboard.copy(@content) when /^.+$/ write_to_file(target) end end end |