Class: LLM::Repl::Input::Row Private
- Inherits:
-
Object
- Object
- LLM::Repl::Input::Row
- Defined in:
- lib/llm/repl/input/row.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.
One line of the input. chars holds the editable characters.
break_type records how this line got started: an auto-wrap
(:space) or a real newline (:newline). The first row has no
break type. It decides how the input is flattened on #take.
Instance Attribute Summary collapse
- #chars ⇒ Array<Input::Char> readonly private
-
#break_type ⇒ Symbol?
private
:spaceor:newline, or nil for the first row.
Instance Method Summary collapse
-
#initialize(break_type = nil) ⇒ Row
constructor
private
A new instance of Row.
- #to_s ⇒ String private
- #empty? ⇒ Boolean private
Constructor Details
#initialize(break_type = nil) ⇒ Row
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.
Returns a new instance of Row.
22 23 24 25 |
# File 'lib/llm/repl/input/row.rb', line 22 def initialize(break_type = nil) @chars = [] @break_type = break_type end |
Instance Attribute Details
#chars ⇒ Array<Input::Char> (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.
12 13 14 |
# File 'lib/llm/repl/input/row.rb', line 12 def chars @chars end |
#break_type ⇒ Symbol?
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.
Returns :space or :newline, or nil for the first row.
17 18 19 |
# File 'lib/llm/repl/input/row.rb', line 17 def break_type @break_type end |
Instance Method Details
#to_s ⇒ 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.
29 30 31 |
# File 'lib/llm/repl/input/row.rb', line 29 def to_s chars.map(&:to_s).join end |
#empty? ⇒ Boolean
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.
35 36 37 |
# File 'lib/llm/repl/input/row.rb', line 35 def empty? chars.empty? end |