Class: Daisy::Feedback::ProgressComponent
- Inherits:
-
LocoMotion::BaseComponent
- Object
- ViewComponent::Base
- LocoMotion::BaseComponent
- Daisy::Feedback::ProgressComponent
- Defined in:
- app/components/daisy/feedback/progress_component.rb
Constant Summary
Constants inherited from LocoMotion::BaseComponent
LocoMotion::BaseComponent::EMPTY_PART_IGNORED_TAGS, LocoMotion::BaseComponent::SELF_CLOSING_TAGS
Instance Attribute Summary
Attributes inherited from LocoMotion::BaseComponent
Instance Method Summary collapse
- #before_render ⇒ Object
- #call ⇒ Object
-
#initialize(*args, **kws, &block) ⇒ ProgressComponent
constructor
Creates a new Progress component.
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
Methods included from LocoMotion::Concerns::InspectableComponent
Constructor Details
#initialize(*args, **kws, &block) ⇒ ProgressComponent
Creates a new Progress component.
45 46 47 48 49 50 |
# File 'app/components/daisy/feedback/progress_component.rb', line 45 def initialize(*args, **kws, &block) super @value = config_option(:value, nil) @max = config_option(:max, 100) end |
Instance Method Details
#before_render ⇒ Object
52 53 54 55 56 |
# File 'app/components/daisy/feedback/progress_component.rb', line 52 def before_render set_tag_name(:component, :progress) add_css(:component, "progress") add_html(:component, { value: @value, max: @max }) unless @value.nil? end |
#call ⇒ Object
58 59 60 |
# File 'app/components/daisy/feedback/progress_component.rb', line 58 def call part(:component) end |