Class: Twterm::Tab::New::List

Inherits:
Object
  • Object
show all
Includes:
Base, Scrollable
Defined in:
lib/twterm/tab/new/list.rb

Constant Summary collapse

@@lists =
nil

Instance Attribute Summary

Attributes included from Base

#title

Instance Method Summary collapse

Methods included from Scrollable

#draw_scroll_bar, #index, #item_appended, #item_prepended, #last, #move_down, #move_to_bottom, #move_to_top, #move_up, #offset, #offset_from_bottom, #update_scrollbar_length

Methods included from Base

#close, #refresh

Constructor Details

#initializeList

Returns a new instance of List.



10
11
12
13
14
# File 'lib/twterm/tab/new/list.rb', line 10

def initialize
  super

  @title = 'New tab'
end

Instance Method Details

#==(other) ⇒ Object



30
31
32
# File 'lib/twterm/tab/new/list.rb', line 30

def ==(other)
  other.is_a?(self.class)
end

#respond_to_key(key) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/twterm/tab/new/list.rb', line 16

def respond_to_key(key)
  return true if super

  case key
  when 10
    return true if current_list.nil?
    list_tab = Tab::ListTab.new(current_list.id)
    TabManager.instance.switch(list_tab)
  else
    return false
  end
  true
end