Class: AskChatgpt::Prompts::WithCode

Inherits:
Base
  • Object
show all
Defined in:
lib/ask_chatgpt/prompts/with_code.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#record

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ WithCode

Returns a new instance of WithCode.



7
8
9
# File 'lib/ask_chatgpt/prompts/with_code.rb', line 7

def initialize(*args)
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



5
6
7
# File 'lib/ask_chatgpt/prompts/with_code.rb', line 5

def args
  @args
end

Instance Method Details

#contentObject



11
12
13
# File 'lib/ask_chatgpt/prompts/with_code.rb', line 11

def content
  code_info.reject { |v| v.blank? }.join("\n")
end