Class: Adva::View::Tabs

Inherits:
Array
  • Object
show all
Defined in:
lib/adva/view/tabs.rb

Defined Under Namespace

Classes: Tab

Instance Method Summary collapse

Methods inherited from Array

#flatten_once, #flatten_once!

Instance Method Details

#tab(name, &block) ⇒ Object



21
22
23
24
25
# File 'lib/adva/view/tabs.rb', line 21

def tab(name, &block)
  tab = detect { |tab| tab.name == name }
  self << tab = Tab.new(self, name) unless tab
  tab.blocks << block
end