Class: Daisy::Navigation::StepComponent
- Inherits:
-
LocoMotion::BaseComponent
- Object
- ViewComponent::Base
- LocoMotion::BaseComponent
- Daisy::Navigation::StepComponent
- Defined in:
- app/components/daisy/navigation/steps_component.rb
Overview
A step within a StepsComponent.
Constant Summary
Constants inherited from LocoMotion::BaseComponent
LocoMotion::BaseComponent::EMPTY_PART_IGNORED_TAGS, LocoMotion::BaseComponent::SELF_CLOSING_TAGS
Instance Attribute Summary collapse
-
#simple ⇒ Object
readonly
Returns the value of attribute simple.
Attributes inherited from LocoMotion::BaseComponent
Instance Method Summary collapse
- #before_render ⇒ Object
- #call ⇒ Object
-
#initialize(*args, **kws, &block) ⇒ StepComponent
constructor
Create a new instance of the StepComponent.
Methods inherited from LocoMotion::BaseComponent
build, #component_ref, #config_option, #cssify, define_modifier, define_modifiers, define_part, define_parts, define_size, define_sizes, #empty_part_content, #inspect, #part, register_component_initializer, register_component_setup, #rendered_css, #rendered_data, #rendered_html, #rendered_stimulus_controllers, #rendered_tag_name, renders_many, renders_one, set_component_name, #set_loco_parent, #strip_spaces
Constructor Details
#initialize(*args, **kws, &block) ⇒ StepComponent
Create a new instance of the StepComponent.
67 68 69 70 71 72 |
# File 'app/components/daisy/navigation/steps_component.rb', line 67 def initialize(*args, **kws, &block) super @simple_title = config_option(:title) @number = config_option(:number) end |
Instance Attribute Details
#simple ⇒ Object (readonly)
Returns the value of attribute simple.
49 50 51 |
# File 'app/components/daisy/navigation/steps_component.rb', line 49 def simple @simple end |
Instance Method Details
#before_render ⇒ Object
74 75 76 77 78 |
# File 'app/components/daisy/navigation/steps_component.rb', line 74 def before_render set_tag_name(:component, :li) add_css(:component, "step") add_html(:component, { data: { content: @number } }) if @number end |
#call ⇒ Object
80 81 82 83 84 85 |
# File 'app/components/daisy/navigation/steps_component.rb', line 80 def call part(:component) do concat(@simple_title) if @simple_title concat(content) if content? end end |