Class: LLM::Repl::Node Private
- Inherits:
-
Object
- Object
- LLM::Repl::Node
- Defined in:
- lib/llm/repl/node.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
The LLM::Repl::Node class wraps a piece of text and optional curses attributes.
Instance Attribute Summary collapse
- #attrs ⇒ Integer? readonly private
- #text ⇒ String readonly private
Instance Method Summary collapse
-
#[](key) ⇒ String, ...
private
Hash-like lookup.
- #initialize(text, attrs = nil) ⇒ LLM::Repl::Node constructor private
Constructor Details
#initialize(text, attrs = nil) ⇒ LLM::Repl::Node
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 24 |
# File 'lib/llm/repl/node.rb', line 21 def initialize(text, attrs = nil) @text = text.to_s @attrs = attrs end |
Instance Attribute Details
#attrs ⇒ Integer? (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/llm/repl/node.rb', line 15 def attrs @attrs end |
#text ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 |
# File 'lib/llm/repl/node.rb', line 11 def text @text end |
Instance Method Details
#[](key) ⇒ String, ...
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Hash-like lookup.
30 31 32 33 34 35 |
# File 'lib/llm/repl/node.rb', line 30 def [](key) case key when :text then @text when :attrs then @attrs end end |