class Tmux::Window::Status::State

Each status can be in different states: normal, current and alert

Attributes

attributes[RW]

@return [Symbol]

background_color[RW]

@return [Symbol]

foreground_color[RW]

@return [Symbol]

format[RW]

The format in which the window is displayed in the status line window list.

@return [String]

Public Class Methods

new(window, state) click to toggle source
# File lib/tmux/window/status/state.rb, line 6
def initialize(window, state)
  @window = window
  @state  = state
end

Public Instance Methods

attributes=(value) click to toggle source
# File lib/tmux/window/status/state.rb, line 57
def attributes=(value)
  # FIXME string? array?
  set_option "attr", value
end
background_color=(color) click to toggle source
# File lib/tmux/window/status/state.rb, line 19
def background_color=(color)
  set_option "fg", color
end
foreground_color=(color) click to toggle source
# File lib/tmux/window/status/state.rb, line 31
def foreground_color=(color)
  set_option "fg", color
end
format=(value) click to toggle source
# File lib/tmux/window/status/state.rb, line 45
def format=(value)
  set_option "format"
end

Private Instance Methods

get_option(option) click to toggle source
# File lib/tmux/window/status/state.rb, line 62
def get_option(option)
  @window.options.get option_name(option)
end
option_name(option) click to toggle source
# 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) click to toggle source
# File lib/tmux/window/status/state.rb, line 67
def set_option(option, value)
  @window.options.set option_name(option), value
end