Class: Echoes::PaneTree::SplitNode

Inherits:
Object
  • Object
show all
Defined in:
lib/echoes/pane_tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(direction:, ratio: 0.5, left:, right:) ⇒ SplitNode

direction: :vertical (left/right split with vertical divider)

:horizontal (top/bottom split with horizontal divider)

ratio: 0.0..1.0, fraction allocated to left/top child



11
12
13
14
15
16
# File 'lib/echoes/pane_tree.rb', line 11

def initialize(direction:, ratio: 0.5, left:, right:)
  @direction = direction
  @ratio = ratio
  @left = left
  @right = right
end

Instance Attribute Details

#directionObject

Returns the value of attribute direction.



6
7
8
# File 'lib/echoes/pane_tree.rb', line 6

def direction
  @direction
end

#leftObject

Returns the value of attribute left.



6
7
8
# File 'lib/echoes/pane_tree.rb', line 6

def left
  @left
end

#ratioObject

Returns the value of attribute ratio.



6
7
8
# File 'lib/echoes/pane_tree.rb', line 6

def ratio
  @ratio
end

#rightObject

Returns the value of attribute right.



6
7
8
# File 'lib/echoes/pane_tree.rb', line 6

def right
  @right
end