Class: Primer::TimelineItemComponent::Badge
- Defined in:
- app/components/primer/timeline_item_component.rb
Constant Summary
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Attribute Summary collapse
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
Instance Method Summary collapse
-
#initialize(icon: nil, **kwargs) ⇒ Badge
constructor
A new instance of Badge.
Methods included from FetchOrFallbackHelper
Methods included from ClassNameHelper
Constructor Details
#initialize(icon: nil, **kwargs) ⇒ Badge
Returns a new instance of Badge.
67 68 69 70 71 72 73 74 75 76 |
# File 'app/components/primer/timeline_item_component.rb', line 67 def initialize(icon: nil, **kwargs) @icon = icon @kwargs = kwargs @kwargs[:tag] = :div @kwargs[:classes] = class_names( "TimelineItem-badge", kwargs[:classes] ) end |
Instance Attribute Details
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
63 64 65 |
# File 'app/components/primer/timeline_item_component.rb', line 63 def icon @icon end |
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
63 64 65 |
# File 'app/components/primer/timeline_item_component.rb', line 63 def kwargs @kwargs end |