Class: Primer::FlexItemComponent
- Defined in:
- app/components/primer/flex_item_component.rb
Overview
:nodoc
Constant Summary collapse
- FLEX_AUTO_DEFAULT =
false- FLEX_AUTO_ALLOWED_VALUES =
[FLEX_AUTO_DEFAULT, true].freeze
Constants inherited from Component
Constants included from FetchOrFallbackHelper
Primer::FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(flex_auto: FLEX_AUTO_DEFAULT, **system_arguments) ⇒ FlexItemComponent
constructor
A new instance of FlexItemComponent.
Methods inherited from Component
Methods included from JoinStyleArgumentsHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean
Methods included from ClassNameHelper
Constructor Details
#initialize(flex_auto: FLEX_AUTO_DEFAULT, **system_arguments) ⇒ FlexItemComponent
Returns a new instance of FlexItemComponent.
9 10 11 12 13 14 15 16 |
# File 'app/components/primer/flex_item_component.rb', line 9 def initialize(flex_auto: FLEX_AUTO_DEFAULT, **system_arguments) @system_arguments = system_arguments @system_arguments[:classes] = class_names( @system_arguments[:classes], "flex-auto" => fetch_or_fallback(FLEX_AUTO_ALLOWED_VALUES, flex_auto, FLEX_AUTO_DEFAULT) ) end |
Instance Method Details
#call ⇒ Object
18 19 20 |
# File 'app/components/primer/flex_item_component.rb', line 18 def call render(Primer::BoxComponent.new(**@system_arguments)) { content } end |