Class: GovukComponent::PaginationComponent::NextPage

Inherits:
AdjacentPage
  • Object
show all
Defined in:
app/components/govuk_component/pagination_component/next_page.rb

Instance Attribute Summary

Attributes inherited from AdjacentPage

#block_mode, #href, #label_text, #suffix, #text, #visually_hidden_text

Attributes inherited from Base

#html_attributes

Instance Method Summary collapse

Methods inherited from AdjacentPage

#call

Methods inherited from Base

#brand, #class_prefix

Constructor Details

#initialize(href:, text:, label_text: nil, block_mode: true, classes: [], html_attributes: {}) ⇒ NextPage

Returns a new instance of NextPage.



2
3
4
5
6
7
8
9
10
11
12
# File 'app/components/govuk_component/pagination_component/next_page.rb', line 2

def initialize(href:, text:, label_text: nil, block_mode: true, classes: [], html_attributes: {})
  super(
    suffix: "next",
    text:,
    href:,
    label_text:,
    block_mode:,
    classes:,
    html_attributes:
  )
end

Instance Method Details

#bodyObject



14
15
16
17
18
# File 'app/components/govuk_component/pagination_component/next_page.rb', line 14

def body
  return [arrow, title_span] if block_mode?

  [title_span, arrow]
end