Class: CCS::Components::GovUK::StepByStepNavigation::Section::Content::List::Item
- Inherits:
-
Object
- Object
- CCS::Components::GovUK::StepByStepNavigation::Section::Content::List::Item
- Includes:
- ActionView::Context, ActionView::Helpers
- Defined in:
- lib/ccs/components/govuk/step_by_step_navigation/section/content/list/item.rb
Overview
GOV.UK Step by step navigation section content list item
Generates the list item HTML for the step by step navigation section content
Instance Method Summary collapse
-
#initialize(text:, no_marker: nil) ⇒ Item
constructor
A new instance of Item.
-
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for an individual the GOV.UK Step by step navigation list item.
Constructor Details
#initialize(text:, no_marker: nil) ⇒ Item
Returns a new instance of Item.
32 33 34 35 |
# File 'lib/ccs/components/govuk/step_by_step_navigation/section/content/list/item.rb', line 32 def initialize(text:, no_marker: nil) @text = text @classes = "gem-c-step-nav__list-item js-list-item #{'gem-c-step-nav__list--no-marker' if no_marker}".rstrip end |
Instance Method Details
#render ⇒ ActiveSupport::SafeBuffer
Generates the HTML for an individual the GOV.UK Step by step navigation list item
41 42 43 44 45 |
# File 'lib/ccs/components/govuk/step_by_step_navigation/section/content/list/item.rb', line 41 def render tag.li(class: classes) do tag.span(text) end end |