Class: ProgressBarHelper::ProgressBarCreator
- Inherits:
-
Object
- Object
- ProgressBarHelper::ProgressBarCreator
- Includes:
- ActionView::Helpers, FormatHelper
- Defined in:
- app/helpers/progress_bar_helper.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#output_buffer ⇒ Object
Returns the value of attribute output_buffer.
Instance Method Summary collapse
-
#initialize(options) ⇒ ProgressBarCreator
constructor
A new instance of ProgressBarCreator.
- #render ⇒ Object
Methods included from FormatHelper
#prepend_class, #squeeze_n_strip
Constructor Details
#initialize(options) ⇒ ProgressBarCreator
Returns a new instance of ProgressBarCreator.
10 11 12 |
# File 'app/helpers/progress_bar_helper.rb', line 10 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'app/helpers/progress_bar_helper.rb', line 7 def @options end |
#output_buffer ⇒ Object
Returns the value of attribute output_buffer.
8 9 10 |
# File 'app/helpers/progress_bar_helper.rb', line 8 def output_buffer @output_buffer end |
Instance Method Details
#render ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'app/helpers/progress_bar_helper.rb', line 14 def render percentage, label = [:style] = "width: #{percentage}%" [:role] = 'progressbar' [:aria] = {valuemax: 100, valuemin: 0, valuenow: percentage} content_tag :div, do label.present? ? label : (content_tag :span, label, class: 'sr-only') end end |