Class: Primer::CloseButton
- Defined in:
- app/components/primer/close_button.rb
Overview
Use CloseButton to render an ‘×` without default button styles.
Constant Summary collapse
- DEFAULT_TYPE =
:button- TYPE_OPTIONS =
[DEFAULT_TYPE, :submit].freeze
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(type: DEFAULT_TYPE, **system_arguments) ⇒ CloseButton
constructor
A new instance of CloseButton.
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Methods included from ClassNameHelper
Constructor Details
#initialize(type: DEFAULT_TYPE, **system_arguments) ⇒ CloseButton
Returns a new instance of CloseButton.
14 15 16 17 18 19 20 21 22 |
# File 'app/components/primer/close_button.rb', line 14 def initialize(type: DEFAULT_TYPE, **system_arguments) @system_arguments = system_arguments @system_arguments[:tag] = :button @system_arguments[:type] = fetch_or_fallback(TYPE_OPTIONS, type, DEFAULT_TYPE) @system_arguments[:classes] = class_names( "close-button", system_arguments[:classes] ) end |
Instance Method Details
#call ⇒ Object
24 25 26 27 28 |
# File 'app/components/primer/close_button.rb', line 24 def call render(Primer::BaseComponent.new(**@system_arguments)) do render(Primer::OcticonComponent.new("x")) end end |