Module: Card::Set::Abstract::Tabs::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb

Instance Method Summary collapse

Instance Method Details

#default_tabObject



29
30
31
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb', line 29

def default_tab
  tab_from_params || tab_map.keys.first
end

#tab_badge(count, label, opts = {}) ⇒ Object



33
34
35
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb', line 33

def tab_badge count, label, opts={}
  haml :tab_badge, badge_haml_opts(count, label, opts)
end

#tab_listObject



21
22
23
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb', line 21

def tab_list
  []
end

#tab_mapObject



17
18
19
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb', line 17

def tab_map
  @tab_map ||= generate_tab_map
end

#tab_optionsObject



25
26
27
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb', line 25

def tab_options
  {}
end

#tab_title(label, opts) ⇒ Object



37
38
39
40
41
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb', line 37

def tab_title label, opts
  opts ||= {}
  label = tab_badge opts[:count], label, opts if opts[:count]
  wrap_with(:div, class: "tab-title") { label }
end

#view: tabsObject



11
12
13
14
15
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb', line 11

view :tabs, cache: :never do
  tabs tab_map, default_tab, load: :lazy do
    _render! tab_map.dig(default_tab, :view)
  end
end