Class: BulmaPhlex::ProgressBar
- Defined in:
- lib/bulma_phlex/progress_bar.rb
Overview
Renders the Bulma progress bar element.
Supports color and size options. Omitting value and max from the HTML attributes
produces an indeterminate (animated) progress bar.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(color: nil, size: nil, **html_attributes) ⇒ ProgressBar
constructor
A new instance of ProgressBar.
- #view_template ⇒ Object
Constructor Details
#initialize(color: nil, size: nil, **html_attributes) ⇒ ProgressBar
Returns a new instance of ProgressBar.
19 20 21 22 23 |
# File 'lib/bulma_phlex/progress_bar.rb', line 19 def initialize(color: nil, size: nil, **html_attributes) @color = color @size = size @html_attributes = html_attributes end |
Class Method Details
.new(color: nil, size: nil, **html_attributes) ⇒ Object
Parameters
color— Color of the progress barsize— Size of the progress bar:"small","normal","medium","large"**html_attributes— Additional HTML attributes for the progress element; usevalueandmaxto set progress
15 16 17 |
# File 'lib/bulma_phlex/progress_bar.rb', line 15 def self.new(color: nil, size: nil, **html_attributes) super end |
Instance Method Details
#view_template ⇒ Object
25 26 27 |
# File 'lib/bulma_phlex/progress_bar.rb', line 25 def view_template(&) progress(**mix({ class: classes }, @html_attributes), &) end |