Class: AskChatgpt::Prompts::Custom

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

Instance Attribute Summary collapse

Attributes inherited from Base

#record

Instance Method Summary collapse

Constructor Details

#initialize(*args, block) ⇒ Custom

Returns a new instance of Custom.



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

def initialize(*args, block)
  @args = args
  @block = block
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



4
5
6
# File 'lib/ask_chatgpt/prompts/custom.rb', line 4

def args
  @args
end

#blockObject (readonly)

Returns the value of attribute block.



4
5
6
# File 'lib/ask_chatgpt/prompts/custom.rb', line 4

def block
  @block
end

Instance Method Details

#contentObject



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

def content
  instance_exec(*args, &block)
end