Class: Tmux::Window::Status::State

Inherits:
Object
  • Object
show all
Defined in:
lib/tmux/window/status/state.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesSymbol

Returns:

  • (Symbol)


50
51
52
# File 'lib/tmux/window/status/state.rb', line 50

def attributes
  @attributes
end

#background_colorSymbol

Returns:

  • (Symbol)


12
13
14
# File 'lib/tmux/window/status/state.rb', line 12

def background_color
  @background_color
end

#foreground_colorSymbol

Returns:

  • (Symbol)


24
25
26
# File 'lib/tmux/window/status/state.rb', line 24

def foreground_color
  @foreground_color
end

#formatString

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

Returns:

  • (String)


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.options.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.options.set option_name(option), value
end