Class: Primer::DetailsComponent::Summary
- Defined in:
- app/components/primer/details_component.rb
Overview
Use the Summary slot as a trigger to reveal the content.
Constant Summary
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
- #component ⇒ Object
-
#initialize(button: true, **system_arguments) ⇒ Summary
constructor
A new instance of Summary.
Methods included from JoinStyleArgumentsHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean
Methods included from ClassNameHelper
Constructor Details
#initialize(button: true, **system_arguments) ⇒ Summary
Returns a new instance of Summary.
39 40 41 42 43 44 45 |
# File 'app/components/primer/details_component.rb', line 39 def initialize(button: true, **system_arguments) @button = @system_arguments = system_arguments @system_arguments[:tag] = :summary @system_arguments[:role] = "button" end |
Instance Method Details
#component ⇒ Object
47 48 49 50 51 |
# File 'app/components/primer/details_component.rb', line 47 def component return Primer::BaseComponent.new(**@system_arguments) unless @button Primer::ButtonComponent.new(**@system_arguments) end |