Class: TmRb::Window
- Inherits:
-
Object
- Object
- TmRb::Window
- Defined in:
- lib/tmrb/window.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name = 'tab', command = 'zsh') ⇒ Window
constructor
Create a tmux window.
-
#to_string ⇒ String
Return the tmux string for the window.
Constructor Details
#initialize(name = 'tab', command = 'zsh') ⇒ Window
Create a tmux window
9 10 11 12 13 14 15 16 17 |
# File 'lib/tmrb/window.rb', line 9 def initialize(name = 'tab', command = 'zsh') name = 'tab' if name == nil or name == '' command = 'zsh' if command == nil or command == '' @name = name @command = command @options = [] end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
3 4 5 |
# File 'lib/tmrb/window.rb', line 3 def command @command end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/tmrb/window.rb', line 3 def name @name end |
Instance Method Details
#to_string ⇒ String
Return the tmux string for the window
22 23 24 25 |
# File 'lib/tmrb/window.rb', line 22 def to_string @options.push %Q{-n "#{name}"} %Q{new-window #{@options.join(' ')} "#{command}"\\;} end |