Class: GovukComponent::LanguageNavigationComponent::Item
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- GovukComponent::LanguageNavigationComponent::Item
- Includes:
- GovukVisuallyHiddenHelper
- Defined in:
- app/components/govuk_component/language_navigation_component.rb
Instance Attribute Summary collapse
-
#any_rtl ⇒ Object
readonly
Returns the value of attribute any_rtl.
-
#current ⇒ Object
readonly
Returns the value of attribute current.
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#href_lang ⇒ Object
readonly
Returns the value of attribute href_lang.
-
#lang ⇒ Object
readonly
Returns the value of attribute lang.
-
#language_description_text ⇒ Object
readonly
Returns the value of attribute language_description_text.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Base
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(text:, lang:, href: nil, language_description_text: nil, current: false, href_lang: nil, dir: 'ltr', any_rtl: false, classes: [], html_attributes: {}) ⇒ Item
constructor
A new instance of Item.
Methods included from GovukVisuallyHiddenHelper
Methods inherited from Base
Constructor Details
#initialize(text:, lang:, href: nil, language_description_text: nil, current: false, href_lang: nil, dir: 'ltr', any_rtl: false, classes: [], html_attributes: {}) ⇒ Item
Returns a new instance of Item.
45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/components/govuk_component/language_navigation_component.rb', line 45 def initialize(text:, lang:, href: nil, language_description_text: nil, current: false, href_lang: nil, dir: 'ltr', any_rtl: false, classes: [], html_attributes: {}) @text = text @lang = lang @href = href @href_lang = href_lang || lang @current = current @language_description_text = language_description_text @dir = dir if any_rtl super(classes:, html_attributes:) end |
Instance Attribute Details
#any_rtl ⇒ Object (readonly)
Returns the value of attribute any_rtl.
43 44 45 |
# File 'app/components/govuk_component/language_navigation_component.rb', line 43 def any_rtl @any_rtl end |
#current ⇒ Object (readonly)
Returns the value of attribute current.
43 44 45 |
# File 'app/components/govuk_component/language_navigation_component.rb', line 43 def current @current end |
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
43 44 45 |
# File 'app/components/govuk_component/language_navigation_component.rb', line 43 def dir @dir end |
#href ⇒ Object (readonly)
Returns the value of attribute href.
43 44 45 |
# File 'app/components/govuk_component/language_navigation_component.rb', line 43 def href @href end |
#href_lang ⇒ Object (readonly)
Returns the value of attribute href_lang.
43 44 45 |
# File 'app/components/govuk_component/language_navigation_component.rb', line 43 def href_lang @href_lang end |
#lang ⇒ Object (readonly)
Returns the value of attribute lang.
43 44 45 |
# File 'app/components/govuk_component/language_navigation_component.rb', line 43 def lang @lang end |
#language_description_text ⇒ Object (readonly)
Returns the value of attribute language_description_text.
43 44 45 |
# File 'app/components/govuk_component/language_navigation_component.rb', line 43 def language_description_text @language_description_text end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
43 44 45 |
# File 'app/components/govuk_component/language_navigation_component.rb', line 43 def text @text end |
Instance Method Details
#call ⇒ Object
57 58 59 |
# File 'app/components/govuk_component/language_navigation_component.rb', line 57 def call tag.li(content, **default_attributes) end |