Class: RawLine::DomTree

Inherits:
TerminalLayout::Box
  • Object
show all
Defined in:
lib/rawline/dom_tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_boxObject

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_boxObject

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_boxObject

Returns the value of attribute prompt_box.



5
6
7
# File 'lib/rawline/dom_tree.rb', line 5

def prompt_box
  @prompt_box
end