Method: Anchor::LogoComponent#initialize
- Defined in:
- app/components/anchor/logo_component.rb
#initialize(variant: VARIANT_DEFAULT, color: COLOR_DEFAULT, **kwargs) ⇒ LogoComponent
Returns a new instance of LogoComponent.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/components/anchor/logo_component.rb', line 25 def initialize( variant: VARIANT_DEFAULT, color: COLOR_DEFAULT, **kwargs ) @variant = VARIANT_MAPPINGS[ fetch_or_fallback(VARIANT_OPTIONS, variant, VARIANT_DEFAULT) ] @color = COLOR_MAPPINGS[ fetch_or_fallback(COLOR_OPTIONS, color, COLOR_DEFAULT) ] @variant_aspect_ratio = VARIANT_ASPECT_RATIO_MAPPINGS[variant] super(**kwargs) end |