Class: Faalis::Dashboard::Helpers::BoxHelpers::Tabs

Inherits:
Object
  • Object
show all
Defined in:
lib/faalis/dashboard/helpers/box_helpers.rb

Defined Under Namespace

Classes: Tab

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Tabs

Returns a new instance of Tabs.



44
45
46
47
# File 'lib/faalis/dashboard/helpers/box_helpers.rb', line 44

def initialize(**options)
  @tabs       = []
  @title_icon = options[:title_icon]
end

Instance Attribute Details

#title_iconObject (readonly)

Returns the value of attribute title_icon.



42
43
44
# File 'lib/faalis/dashboard/helpers/box_helpers.rb', line 42

def title_icon
  @title_icon
end

Instance Method Details

#tab(title, **options, &block) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/faalis/dashboard/helpers/box_helpers.rb', line 50

def tab(title, **options, &block)
  id  = @tabs.length
  tab = Tab.new(title, **options)
  tab.content = block
  tab.id = id
  @tabs << tab
end

#tabsObject



58
59
60
# File 'lib/faalis/dashboard/helpers/box_helpers.rb', line 58

def tabs
  @tabs
end