Class: RawLine::DomTree
- Inherits:
-
TerminalLayout::Box
- Object
- TerminalLayout::Box
- RawLine::DomTree
- Defined in:
- lib/rawline/dom_tree.rb
Instance Attribute Summary collapse
-
#content_box ⇒ Object
Returns the value of attribute content_box.
-
#input_box ⇒ Object
Returns the value of attribute input_box.
-
#prompt_box ⇒ Object
Returns the value of attribute prompt_box.
Instance Method Summary collapse
-
#initialize(children: nil) ⇒ DomTree
constructor
A new instance of DomTree.
Constructor Details
#initialize(children: nil) ⇒ DomTree
Returns a new instance of DomTree.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rawline/dom_tree.rb', line 7 def initialize(children: nil) unless children @prompt_box = TerminalLayout::Box.new(content: "default-prompt>", style: {display: :inline}) @input_box = TerminalLayout::InputBox.new(content: "", style: {display: :inline}) @content_box = TerminalLayout::Box.new(content: "", style: {display: :block}) super(style: {}, children: [@prompt_box, @input_box, @content_box]) else super(style: {}, children: children) end end |
Instance Attribute Details
#content_box ⇒ Object
Returns the value of attribute content_box.
5 6 7 |
# File 'lib/rawline/dom_tree.rb', line 5 def content_box @content_box end |
#input_box ⇒ Object
Returns the value of attribute input_box.
5 6 7 |
# File 'lib/rawline/dom_tree.rb', line 5 def input_box @input_box end |
#prompt_box ⇒ Object
Returns the value of attribute prompt_box.
5 6 7 |
# File 'lib/rawline/dom_tree.rb', line 5 def prompt_box @prompt_box end |