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