Class: Primer::SubheadComponent::Heading
- Inherits:
-
ViewComponent::Slot
- Object
- ViewComponent::Slot
- Primer::SubheadComponent::Heading
- Includes:
- ClassNameHelper
- Defined in:
- app/components/primer/subhead_component.rb
Instance Attribute Summary collapse
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
Instance Method Summary collapse
-
#initialize(danger: false, **kwargs) ⇒ Heading
constructor
A new instance of Heading.
Methods included from ClassNameHelper
Constructor Details
#initialize(danger: false, **kwargs) ⇒ Heading
Returns a new instance of Heading.
77 78 79 80 81 82 83 84 85 |
# File 'app/components/primer/subhead_component.rb', line 77 def initialize(danger: false, **kwargs) @kwargs = kwargs @kwargs[:tag] ||= :div @kwargs[:classes] = class_names( @kwargs[:classes], "Subhead-heading", "Subhead-heading--danger": danger ) end |
Instance Attribute Details
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
73 74 75 |
# File 'app/components/primer/subhead_component.rb', line 73 def kwargs @kwargs end |