Class: Primer::TimelineItemComponent
- Includes:
- ViewComponent::Slotable
- Defined in:
- app/components/primer/timeline_item_component.rb
Defined Under Namespace
Constant Summary
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Attribute Summary collapse
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
Instance Method Summary collapse
-
#initialize(condensed: false, **kwargs) ⇒ TimelineItemComponent
constructor
A new instance of TimelineItemComponent.
- #render? ⇒ Boolean
Methods included from FetchOrFallbackHelper
Methods included from ClassNameHelper
Constructor Details
#initialize(condensed: false, **kwargs) ⇒ TimelineItemComponent
Returns a new instance of TimelineItemComponent.
12 13 14 15 16 17 18 19 20 |
# File 'app/components/primer/timeline_item_component.rb', line 12 def initialize(condensed: false, **kwargs) @kwargs = kwargs @kwargs[:tag] = :div @kwargs[:classes] = class_names( "TimelineItem", condensed ? "TimelineItem--condensed" : "", kwargs[:classes] ) end |
Instance Attribute Details
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
11 12 13 |
# File 'app/components/primer/timeline_item_component.rb', line 11 def kwargs @kwargs end |
Instance Method Details
#render? ⇒ Boolean
22 23 24 |
# File 'app/components/primer/timeline_item_component.rb', line 22 def render? avatar.present? || badge.present? || body.present? end |