Class: DsfrComponent::Base

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/dsfr_component/base.rb

Constant Summary collapse

HEADING_LEVELS =
[1, 2, 3, 4, 5, 6].freeze
SIZES =
i[sm md lg].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(html_attributes: {}) ⇒ Base

Returns a new instance of Base.



12
13
14
15
16
17
18
# File 'app/components/dsfr_component/base.rb', line 12

def initialize(html_attributes: {})
  @html_attributes = default_attributes
    .deep_merge_html_attributes(html_attributes)
    .deep_tidy_html_attributes

  super
end

Instance Attribute Details

#html_attributesObject (readonly)

Returns the value of attribute html_attributes.



4
5
6
# File 'app/components/dsfr_component/base.rb', line 4

def html_attributes
  @html_attributes
end