Class: GovukComponent::Base

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
Govuk::Components::Helpers::CssUtilities, Traits::CustomClasses, Traits::CustomHtmlAttributes
Defined in:
app/components/govuk_component/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Traits::CustomClasses

#classes

Methods included from Govuk::Components::Helpers::CssUtilities

#combine_classes

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_attributesObject (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_classesObject



16
17
18
# File 'app/components/govuk_component/base.rb', line 16

def default_classes
  []
end