Class: ChatgptRb::DSL::Base
- Inherits:
-
Object
- Object
- ChatgptRb::DSL::Base
- Defined in:
- lib/chatgpt_rb/dsl/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(object) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(object) ⇒ Base
Returns a new instance of Base.
15 16 17 |
# File 'lib/chatgpt_rb/dsl/base.rb', line 15 def initialize(object) @object = object end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
12 13 14 |
# File 'lib/chatgpt_rb/dsl/base.rb', line 12 def object @object end |
Class Method Details
.configure(object, &configuration) ⇒ Chatgpt::Conversation, ...
7 8 9 10 |
# File 'lib/chatgpt_rb/dsl/base.rb', line 7 def self.configure(object, &configuration) new(object).instance_eval(&configuration) object end |
.supported_fields(fields) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/chatgpt_rb/dsl/base.rb', line 20 def self.supported_fields(fields) fields.each do |method_name| define_method method_name do |value| object.public_send("#{method_name}=", value) end end end |