Class: Tmux::Window::Status::State
- Inherits:
-
Object
- Object
- Tmux::Window::Status::State
- Defined in:
- lib/tmux/window/status/state.rb
Overview
Each status can be in different states: normal, current and alert
Instance Attribute Summary collapse
- #attributes ⇒ Symbol
- #background_color ⇒ Symbol
- #foreground_color ⇒ Symbol
-
#format ⇒ String
The format in which the window is displayed in the status line window list.
Instance Method Summary collapse
- #get_option(option) ⇒ Undefined private
-
#initialize(window, state) ⇒ State
constructor
A new instance of State.
- #option_name(option) ⇒ Undefined private
- #set_option(option, value) ⇒ Undefined private
Constructor Details
#initialize(window, state) ⇒ State
Returns a new instance of State.
6 7 8 9 |
# File 'lib/tmux/window/status/state.rb', line 6 def initialize(window, state) @window = window @state = state end |
Instance Attribute Details
#attributes ⇒ Symbol
50 51 52 |
# File 'lib/tmux/window/status/state.rb', line 50 def attributes @attributes end |
#background_color ⇒ Symbol
12 13 14 |
# File 'lib/tmux/window/status/state.rb', line 12 def background_color @background_color end |
#foreground_color ⇒ Symbol
24 25 26 |
# File 'lib/tmux/window/status/state.rb', line 24 def foreground_color @foreground_color end |
#format ⇒ String
The format in which the window is displayed in the status line window list.
38 39 40 |
# File 'lib/tmux/window/status/state.rb', line 38 def format @format end |
Instance Method Details
#get_option(option) ⇒ Undefined (private)
62 63 64 |
# File 'lib/tmux/window/status/state.rb', line 62 def get_option(option) @window..get option_name(option) end |
#option_name(option) ⇒ Undefined (private)
72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/tmux/window/status/state.rb', line 72 def option_name(option) state = case @state when :normal "" when :current "current-" when :alert "alert-" end "window-status-#{state}#{option}" end |
#set_option(option, value) ⇒ Undefined (private)
67 68 69 |
# File 'lib/tmux/window/status/state.rb', line 67 def set_option(option, value) @window..set option_name(option), value end |