Class: AccordionBuilderHelper::AccordionBuilder

Inherits:
Object
  • Object
show all
Defined in:
app/builders/accordion_builder_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts, parent) ⇒ AccordionBuilder

Returns a new instance of AccordionBuilder.



16
17
18
19
20
# File 'app/builders/accordion_builder_helper.rb', line 16

def initialize(opts, parent)
  @fieldset_rendered_counter = 0
  @parent = parent
  @opts = opts
end

Instance Attribute Details

#fieldset_rendered_counterObject (readonly)

Returns the value of attribute fieldset_rendered_counter.



13
14
15
# File 'app/builders/accordion_builder_helper.rb', line 13

def fieldset_rendered_counter
  @fieldset_rendered_counter
end

#optsObject (readonly)

Returns the value of attribute opts.



13
14
15
# File 'app/builders/accordion_builder_helper.rb', line 13

def opts
  @opts
end

#parentObject (readonly)

Returns the value of attribute parent.



13
14
15
# File 'app/builders/accordion_builder_helper.rb', line 13

def parent
  @parent
end

Instance Method Details

#pane(title, fieldset_opts = {}, &block) ⇒ Object



22
23
24
25
26
# File 'app/builders/accordion_builder_helper.rb', line 22

def pane(title, fieldset_opts = {}, &block)
  (:div, :class => 'accordion-group') do
    heading(title, fieldset_opts) + body(title, fieldset_opts, &block)
  end
end