Class: NfgUi::Bootstrap::Components::ProgressBar

Inherits:
Progress
  • Object
show all
Includes:
Utilities::Progressable, Utilities::Themeable
Defined in:
lib/nfg_ui/bootstrap/components/progress_bar.rb

Overview

Bootstrap Progress Bar Component getbootstrap.com/docs/4.1/components/progress/

Direct Known Subclasses

Components::Elements::ProgressBar

Instance Attribute Summary

Attributes inherited from Base

#body, #options, #view_context

Instance Method Summary collapse

Methods included from Utilities::Themeable

#outlined, #theme

Methods included from Utilities::Progressable

#animated, #label, #progress, #striped, #theme

Methods inherited from Progress

#height

Methods inherited from Base

#data, #href, #html_options, #id, #initialize

Constructor Details

This class inherits a constructor from NfgUi::Bootstrap::Components::Base

Instance Method Details

#component_familyObject



12
13
14
# File 'lib/nfg_ui/bootstrap/components/progress_bar.rb', line 12

def component_family
  :progress
end

#renderObject



23
24
25
# File 'lib/nfg_ui/bootstrap/components/progress_bar.rb', line 23

def render
  (:div, label, html_options)
end

#styleObject



16
17
18
19
20
21
# File 'lib/nfg_ui/bootstrap/components/progress_bar.rb', line 16

def style
  [
    options[:style],
    ("width: #{progress.to_i}%;" if progress)
  ].join(' ').squish
end