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

- (State) initialize(window, 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

- (Symbol) attributes

Returns:

  • (Symbol)


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

def attributes
  get_option "attr"
end

- (Symbol) background_color

Returns:

  • (Symbol)


14
15
16
# File 'lib/tmux/window/status/state.rb', line 14

def background_color
  get_option "bg"
end

- (Symbol) foreground_color

Returns:

  • (Symbol)


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.

Returns:

  • (String)


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