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)
- - (Symbol) attributes
- - (Symbol) background_color
- - (Symbol) foreground_color
-
- (String) format
The format in which the window is displayed in the status line window list.
Instance Method Summary (collapse)
- - (Undefined) get_option(option) private
-
- (State) initialize(window, state)
constructor
A new instance of State.
- - (Undefined) option_name(option) private
- - (Undefined) set_option(option, value) private
Constructor Details
- (State) initialize(window, state)
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
- (Symbol) attributes
49 50 51 |
# File 'lib/tmux/window/status/state.rb', line 49 def attributes get_option "attr" end |
- (Symbol) background_color
14 15 16 |
# File 'lib/tmux/window/status/state.rb', line 14 def background_color get_option "bg" end |
- (Symbol) foreground_color
25 26 27 |
# File 'lib/tmux/window/status/state.rb', line 25 def foreground_color get_option "fg" end |
- (String) format
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 get_option "format" end |
Instance Method Details
- (Undefined) get_option(option) (private)
58 59 60 |
# File 'lib/tmux/window/status/state.rb', line 58 def get_option(option) @window..get option_name(option) end |
- (Undefined) option_name(option) (private)
68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/tmux/window/status/state.rb', line 68 def option_name(option) state = case @state when :normal "" when :current "current-" when :alert "alert-" end "window-status-#{state}#{option}" end |
- (Undefined) set_option(option, value) (private)
63 64 65 |
# File 'lib/tmux/window/status/state.rb', line 63 def set_option(option, value) @window..set option_name(option), value end |