Class: Anchor::Component
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Anchor::Component
- Includes:
- FetchOrFallbackHelper, ViewHelper
- Defined in:
- app/components/anchor/component.rb
Direct Known Subclasses
ActionMenuComponent, AutocompleteComponent, BadgeComponent, BannerComponent, Breadcrumbs::ItemComponent, BreadcrumbsComponent, ButtonComponent, DialogComponent, IconComponent, LoadingIndicatorComponent, Panel::BodyComponent, Panel::FooterComponent, Panel::HeaderComponent, PanelComponent, ProseComponent, TabBar::TabComponent, TabBarComponent, TextComponent, ToastComponent
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(classes: nil, data: {}, **kwargs) ⇒ Component
constructor
A new instance of Component.
Methods included from ViewHelper
Methods included from FetchOrFallbackHelper
Constructor Details
#initialize(classes: nil, data: {}, **kwargs) ⇒ Component
Returns a new instance of Component.
10 11 12 13 14 15 |
# File 'app/components/anchor/component.rb', line 10 def initialize(classes: nil, data: {}, **kwargs) @classes = classes @data = data super end |
Class Method Details
.generate_id(base_name: name.demodulize.underscore.dasherize) ⇒ Object
6 7 8 |
# File 'app/components/anchor/component.rb', line 6 def self.generate_id(base_name: name.demodulize.underscore.dasherize) "#{base_name}-#{SecureRandom.uuid}" end |