Class: GovukComponent::PaginationComponent::AdjacentPage
- Inherits:
-
Base
- Object
- ViewComponent::Base
- Base
- GovukComponent::PaginationComponent::AdjacentPage
- Defined in:
- app/components/govuk_component/pagination_component/adjacent_page.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#block_mode ⇒ Object
(also: #block_mode?)
readonly
Returns the value of attribute block_mode.
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#label_text ⇒ Object
readonly
Returns the value of attribute label_text.
-
#suffix ⇒ Object
readonly
Returns the value of attribute suffix.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#visually_hidden_text ⇒ Object
readonly
Returns the value of attribute visually_hidden_text.
Attributes inherited from Base
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(href:, suffix:, text:, block_mode: true, label_text: nil, classes: [], html_attributes: {}) ⇒ AdjacentPage
constructor
A new instance of AdjacentPage.
Methods inherited from Base
Constructor Details
#initialize(href:, suffix:, text:, block_mode: true, label_text: nil, classes: [], html_attributes: {}) ⇒ AdjacentPage
Returns a new instance of AdjacentPage.
5 6 7 8 9 10 11 12 13 |
# File 'app/components/govuk_component/pagination_component/adjacent_page.rb', line 5 def initialize(href:, suffix:, text:, block_mode: true, label_text: nil, classes: [], html_attributes: {}) @href = href @label_text = label_text @text = text @block_mode = block_mode @suffix = suffix super(html_attributes:, classes:) end |
Instance Attribute Details
#block_mode ⇒ Object (readonly) Also known as: block_mode?
Returns the value of attribute block_mode.
2 3 4 |
# File 'app/components/govuk_component/pagination_component/adjacent_page.rb', line 2 def block_mode @block_mode end |
#href ⇒ Object (readonly)
Returns the value of attribute href.
2 3 4 |
# File 'app/components/govuk_component/pagination_component/adjacent_page.rb', line 2 def href @href end |
#label_text ⇒ Object (readonly)
Returns the value of attribute label_text.
2 3 4 |
# File 'app/components/govuk_component/pagination_component/adjacent_page.rb', line 2 def label_text @label_text end |
#suffix ⇒ Object (readonly)
Returns the value of attribute suffix.
2 3 4 |
# File 'app/components/govuk_component/pagination_component/adjacent_page.rb', line 2 def suffix @suffix end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
2 3 4 |
# File 'app/components/govuk_component/pagination_component/adjacent_page.rb', line 2 def text @text end |
#visually_hidden_text ⇒ Object (readonly)
Returns the value of attribute visually_hidden_text.
2 3 4 |
# File 'app/components/govuk_component/pagination_component/adjacent_page.rb', line 2 def visually_hidden_text @visually_hidden_text end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 |
# File 'app/components/govuk_component/pagination_component/adjacent_page.rb', line 15 def call tag.div(**html_attributes) do tag.a(href:, class: ["#{brand}-link", "#{brand}-pagination__link"], rel: suffix) do safe_join([body, divider, label_content]) end end end |