Class: GovukComponent::Base
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- GovukComponent::Base
- Includes:
- Govuk::Components::Helpers::CssUtilities, Traits::CustomClasses, Traits::CustomHtmlAttributes
- Defined in:
- app/components/govuk_component/base.rb
Direct Known Subclasses
AccordionComponent, AccordionComponent::SectionComponent, BackLinkComponent, BreadcrumbsComponent, CookieBannerComponent, CookieBannerComponent::MessageComponent, DetailsComponent, FooterComponent, HeaderComponent, HeaderComponent::NavigationItem, HeaderComponent::ProductName, InsetTextComponent, NotificationBannerComponent, NotificationBannerComponent::Heading, PanelComponent, PhaseBannerComponent, StartButtonComponent, SummaryListComponent, SummaryListComponent::ActionComponent, SummaryListComponent::KeyComponent, SummaryListComponent::RowComponent, SummaryListComponent::ValueComponent, TabComponent, TabComponent::Tab, TableComponent, TableComponent::BodyComponent, TableComponent::CaptionComponent, TableComponent::CellComponent, TableComponent::HeadComponent, TableComponent::RowComponent, TagComponent, WarningTextComponent
Instance Attribute Summary collapse
-
#html_attributes ⇒ Object
readonly
Returns the value of attribute html_attributes.
Instance Method Summary collapse
- #default_classes ⇒ Object
-
#initialize(classes:, html_attributes:) ⇒ Base
constructor
A new instance of Base.
Methods included from Traits::CustomClasses
Methods included from Govuk::Components::Helpers::CssUtilities
Constructor Details
#initialize(classes:, html_attributes:) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 14 |
# File 'app/components/govuk_component/base.rb', line 9 def initialize(classes:, html_attributes:) @classes = parse_classes(classes) @html_attributes = html_attributes super end |
Instance Attribute Details
#html_attributes ⇒ Object (readonly)
Returns the value of attribute html_attributes.
7 8 9 |
# File 'app/components/govuk_component/base.rb', line 7 def html_attributes @html_attributes end |
Instance Method Details
#default_classes ⇒ Object
16 17 18 |
# File 'app/components/govuk_component/base.rb', line 16 def default_classes [] end |