Class: RubyLLM::Contract::Prompt::Nodes::SectionNode
- Inherits:
-
RubyLLM::Contract::Prompt::Node
- Object
- RubyLLM::Contract::Prompt::Node
- RubyLLM::Contract::Prompt::Nodes::SectionNode
- Defined in:
- lib/ruby_llm/contract/prompt/nodes/section_node.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from RubyLLM::Contract::Prompt::Node
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name, content) ⇒ SectionNode
constructor
A new instance of SectionNode.
- #to_h ⇒ Object
Constructor Details
#initialize(name, content) ⇒ SectionNode
Returns a new instance of SectionNode.
10 11 12 13 |
# File 'lib/ruby_llm/contract/prompt/nodes/section_node.rb', line 10 def initialize(name, content) @name = name.freeze super(type: :section, content: content) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/ruby_llm/contract/prompt/nodes/section_node.rb', line 8 def name @name end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 |
# File 'lib/ruby_llm/contract/prompt/nodes/section_node.rb', line 15 def ==(other) other.is_a?(self.class) && type == other.type && name == other.name && content == other.content end |
#to_h ⇒ Object
19 20 21 |
# File 'lib/ruby_llm/contract/prompt/nodes/section_node.rb', line 19 def to_h { type: :section, name: @name, content: @content } end |