Class: GatherContent::DSL::Tab

Inherits:
Object
  • Object
show all
Defined in:
lib/gather_content/dsl/tab.rb

Instance Method Summary collapse

Constructor Details

#initialize(builder) ⇒ Tab

Returns a new instance of Tab.



11
12
13
14
# File 'lib/gather_content/dsl/tab.rb', line 11

def initialize(builder)
  @tab = GatherContent::Config::Tab.new
  builder.tabs << @tab
end

Instance Method Details

#choice_checkbox(&block) ⇒ Object



43
44
45
46
# File 'lib/gather_content/dsl/tab.rb', line 43

def choice_checkbox(&block)
  dsl = GatherContent::DSL::ChoiceCheckbox.new(@tab)
  dsl.instance_eval(&block)
end

#choice_radio(&block) ⇒ Object



38
39
40
41
# File 'lib/gather_content/dsl/tab.rb', line 38

def choice_radio(&block)
  dsl = GatherContent::DSL::ChoiceRadio.new(@tab)
  dsl.instance_eval(&block)
end

#files(&block) ⇒ Object



33
34
35
36
# File 'lib/gather_content/dsl/tab.rb', line 33

def files(&block)
  dsl = GatherContent::DSL::Files.new(@tab)
  dsl.instance_eval(&block)
end

#hidden(hidden) ⇒ Object



24
25
26
# File 'lib/gather_content/dsl/tab.rb', line 24

def hidden(hidden)
  @tab.hidden = hidden
end

#label(label) ⇒ Object



16
17
18
# File 'lib/gather_content/dsl/tab.rb', line 16

def label(label)
  @tab.label = label
end

#name(name) ⇒ Object



20
21
22
# File 'lib/gather_content/dsl/tab.rb', line 20

def name(name)
  @tab.name = name
end

#section(&block) ⇒ Object



48
49
50
51
# File 'lib/gather_content/dsl/tab.rb', line 48

def section(&block)
  dsl = GatherContent::DSL::Section.new(@tab)
  dsl.instance_eval(&block)
end

#text(&block) ⇒ Object



28
29
30
31
# File 'lib/gather_content/dsl/tab.rb', line 28

def text(&block)
  dsl = GatherContent::DSL::Text.new(@tab)
  dsl.instance_eval(&block)
end