Class: Primer::ProgressBarComponent::Item
- Inherits:
-
ViewComponent::Slot
- Object
- ViewComponent::Slot
- Primer::ProgressBarComponent::Item
- Includes:
- ClassNameHelper
- Defined in:
- app/components/primer/progress_bar_component.rb
Instance Attribute Summary collapse
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
Instance Method Summary collapse
-
#initialize(percentage: 0, bg: :green, **kwargs) ⇒ Item
constructor
A new instance of Item.
Methods included from ClassNameHelper
Constructor Details
#initialize(percentage: 0, bg: :green, **kwargs) ⇒ Item
Returns a new instance of Item.
65 66 67 68 69 70 71 72 73 |
# File 'app/components/primer/progress_bar_component.rb', line 65 def initialize(percentage: 0, bg: :green, **kwargs) @percentage = percentage @kwargs = kwargs @kwargs[:tag] = :span @kwargs[:bg] = bg @kwargs[:style] = "width: #{@percentage}%;" @kwargs[:classes] = class_names("Progress-item", @kwargs[:classes]) end |
Instance Attribute Details
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
60 61 62 |
# File 'app/components/primer/progress_bar_component.rb', line 60 def kwargs @kwargs end |