Class: GovukComponent::TabComponent

Inherits:
Base
  • Object
show all
Defined in:
app/components/govuk_component/tab_component.rb

Defined Under Namespace

Classes: Tab

Instance Attribute Summary collapse

Attributes inherited from Base

#html_attributes

Instance Method Summary collapse

Methods inherited from Base

#brand, #class_prefix

Constructor Details

#initialize(title: 'Contents', id: nil, classes: [], html_attributes: {}) ⇒ TabComponent

Returns a new instance of TabComponent.



8
9
10
11
12
13
# File 'app/components/govuk_component/tab_component.rb', line 8

def initialize(title: 'Contents', id: nil, classes: [], html_attributes: {})
  @title = title
  @id    = id

  super(classes:, html_attributes:)
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'app/components/govuk_component/tab_component.rb', line 6

def id
  @id
end

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'app/components/govuk_component/tab_component.rb', line 6

def title
  @title
end