Class: Tlux::Pane

Inherits:
Object
  • Object
show all
Includes:
Commandable, Splitable
Defined in:
lib/tlux/pane.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Commandable

#command, #commands, #directory

Methods included from Splitable

#panes, #split

Constructor Details

#initialize(orientation = :vertical, opts = {}) ⇒ Pane

Returns a new instance of Pane.



8
9
10
11
12
# File 'lib/tlux/pane.rb', line 8

def initialize(orientation = :vertical, opts = {})
  @orientation = orientation
  @lines = opts[:lines]
  @percentage = opts[:percentage]
end

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



6
7
8
# File 'lib/tlux/pane.rb', line 6

def lines
  @lines
end

#percentageObject (readonly)

Returns the value of attribute percentage.



6
7
8
# File 'lib/tlux/pane.rb', line 6

def percentage
  @percentage
end

Instance Method Details

#orientationObject



14
15
16
# File 'lib/tlux/pane.rb', line 14

def orientation
  "-#{@orientation.to_s.chars.first}"
end

#sizeObject



18
19
20
21
22
23
24
# File 'lib/tlux/pane.rb', line 18

def size
  if lines
    "-l #{lines}"
  elsif percentage
    "-p #{percentage}"
  end
end