Class: DaisyUI::RadialProgress
- Defined in:
- lib/daisy_ui/radial_progress.rb
Constant Summary
Constants inherited from Base
Base::BOOLS, Base::COLOR_MODIFIERS
Instance Method Summary collapse
-
#initialize(value:, as: :div, size: nil, thickness: nil) ⇒ RadialProgress
constructor
A new instance of RadialProgress.
- #view_template ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(value:, as: :div, size: nil, thickness: nil) ⇒ RadialProgress
Returns a new instance of RadialProgress.
7 8 9 10 11 12 |
# File 'lib/daisy_ui/radial_progress.rb', line 7 def initialize(*, value:, as: :div, size: nil, thickness: nil, **) super(*, as:, **) @value = value @size = size @thickness = thickness end |
Instance Method Details
#view_template ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/daisy_ui/radial_progress.rb', line 14 def view_template(&) style = .delete(:style) # Build style string style_parts = [] style_parts << style if style && !style.empty? style_parts << "--value: #{value};" style_parts << "--size: #{size};" if size && !size.to_s.empty? style_parts << "--thickness: #{thickness};" if thickness && !thickness.to_s.empty? public_send(as, role: :progressbar, class: classes, style: style_parts.join(" "), **attributes, &) end |