class Tabulous::Tabset

Public Class Methods

new() click to toggle source
# File lib/tabulous/tabset.rb, line 4
def initialize
  @tabs = []
end

Public Instance Methods

active_primary_tab(view) click to toggle source
# File lib/tabulous/tabset.rb, line 23
def active_primary_tab(view)
  for tab in primary_tabs
    return tab if tab.active?(view)
  end
  nil
end
add_tab(tab) click to toggle source
# File lib/tabulous/tabset.rb, line 8
def add_tab(tab)
  if @tabs.map(&:name).include?(tab.name)
    raise TabNameError, "There is already a tab named '#{tab.name}'."
  end
  @tabs << tab
end
primary_tabs() click to toggle source
# File lib/tabulous/tabset.rb, line 19
def primary_tabs
  @tabs.reject(&:subtab?)
end
tabs() click to toggle source
# File lib/tabulous/tabset.rb, line 15
def tabs
  @tabs
end
visible_subtabs(view) click to toggle source
# File lib/tabulous/tabset.rb, line 30
def visible_subtabs(view)
  if active_primary_tab(view).nil?
    []
  else
    active_primary_tab(view).subtabs.select{|subtab| subtab.visible?(view)}
  end
end