Class: Clacky::UI2::OutputBuffer::Entry
- Inherits:
-
Struct
- Object
- Struct
- Clacky::UI2::OutputBuffer::Entry
- Defined in:
- lib/clacky/ui2/output_buffer.rb
Overview
A single logical output entry.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Monotonic id, unique within the buffer.
-
#lines ⇒ Object
readonly
Rendered (already-wrapped) visual lines.
Instance Method Summary collapse
-
#committed(value) ⇒ Object
True once pushed into terminal scrollback.
-
#height ⇒ Object
Visual row count this entry occupies on screen (before it’s committed).
-
#kind(value) ⇒ Object
:text | :progress | :system (hint for renderer).
- #to_s ⇒ Object
Instance Attribute Details
#id ⇒ Object (readonly)
Monotonic id, unique within the buffer
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/clacky/ui2/output_buffer.rb', line 36 Entry = Struct.new(:id, :lines, :kind, :committed, keyword_init: true) do # Visual row count this entry occupies on screen (before it's committed) def height lines.length end def to_s lines.join("\n") end end |
#lines ⇒ Object (readonly)
Rendered (already-wrapped) visual lines
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/clacky/ui2/output_buffer.rb', line 36 Entry = Struct.new(:id, :lines, :kind, :committed, keyword_init: true) do # Visual row count this entry occupies on screen (before it's committed) def height lines.length end def to_s lines.join("\n") end end |
Instance Method Details
#committed=(value) ⇒ Object
True once pushed into terminal scrollback
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/clacky/ui2/output_buffer.rb', line 36 Entry = Struct.new(:id, :lines, :kind, :committed, keyword_init: true) do # Visual row count this entry occupies on screen (before it's committed) def height lines.length end def to_s lines.join("\n") end end |
#height ⇒ Object
Visual row count this entry occupies on screen (before it’s committed)
38 39 40 |
# File 'lib/clacky/ui2/output_buffer.rb', line 38 def height lines.length end |
#kind=(value) ⇒ Object
:text | :progress | :system (hint for renderer)
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/clacky/ui2/output_buffer.rb', line 36 Entry = Struct.new(:id, :lines, :kind, :committed, keyword_init: true) do # Visual row count this entry occupies on screen (before it's committed) def height lines.length end def to_s lines.join("\n") end end |
#to_s ⇒ Object
42 43 44 |
# File 'lib/clacky/ui2/output_buffer.rb', line 42 def to_s lines.join("\n") end |