Class: FoxTail::StepperComponent

Inherits:
BaseComponent show all
Defined in:
app/components/fox_tail/stepper_component.rb

Instance Attribute Summary

Attributes inherited from BaseComponent

#html_attributes

Instance Method Summary collapse

Methods inherited from BaseComponent

classname_merger, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class

Methods inherited from Base

fox_tail_config

Constructor Details

#initialize(html_attributes = {}) ⇒ StepperComponent

Returns a new instance of StepperComponent.



13
14
15
16
17
# File 'app/components/fox_tail/stepper_component.rb', line 13

def initialize(html_attributes = {})
  super

  @index = 0
end

Instance Method Details

#before_renderObject



23
24
25
26
27
# File 'app/components/fox_tail/stepper_component.rb', line 23

def before_render
  super

  html_attributes[:class] = classnames theme.apply(:root, self), html_class
end

#callObject



29
30
31
32
33
# File 'app/components/fox_tail/stepper_component.rb', line 29

def call
   :ol, html_attributes do
    steps.each { |step| concat step }
  end
end

#render?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/components/fox_tail/stepper_component.rb', line 19

def render?
  steps?
end