Class: Primer::DetailsComponent::Summary

Inherits:
Slot
  • Object
show all
Defined in:
app/components/primer/details_component.rb

Constant Summary

Constants included from FetchOrFallbackHelper

FetchOrFallbackHelper::InvalidValueError

Instance Method Summary collapse

Methods included from FetchOrFallbackHelper

#fetch_or_fallback

Methods included from ClassNameHelper

#class_names

Constructor Details

#initialize(button: true, **system_arguments) ⇒ Summary

Returns a new instance of Summary.



37
38
39
40
41
42
43
# File 'app/components/primer/details_component.rb', line 37

def initialize(button: true, **system_arguments)
  @button = button

  @system_arguments = system_arguments
  @system_arguments[:tag] = :summary
  @system_arguments[:role] = "button"
end

Instance Method Details

#componentObject



45
46
47
48
49
# File 'app/components/primer/details_component.rb', line 45

def component
  return Primer::BaseComponent.new(**@system_arguments) unless @button

  Primer::ButtonComponent.new(**@system_arguments)
end