Sha256: 0d8904e5c9383f366620b2cb82560811e1080c734e91c5fc2de1a77bc5ab4c43
Contents?: true
Size: 1.49 KB
Versions: 20
Compression:
Stored size: 1.49 KB
Contents
require 'action_view' require_relative 'list/item' module CCS module Components module GovUK class StepByStepNavigation < Base class Section < Base class Content # = GOV.UK Step by step navigation section content list # # Generates the list HTML for the step by step navigation section content # # @!attribute [r] items # @return [Item] Array of initialised list items class List include ActionView::Context include ActionView::Helpers private attr_reader :items public # @param items [Array<Hash>] An array of options for the list items # See {Components::GovUK::StepByStepNavigation::Section::Content::List::Item#initialize Item#initialize} for details of the items in the array. def initialize(items:) @items = items.map { |item| Item.new(**item) } end # Generates the HTML for the GOV.UK Step by step navigation section content list # # @return [ActiveSupport::SafeBuffer] def render tag.ul(class: 'gem-c-step-nav__list gem-c-step-nav__list--choice', data: { length: items.length.to_s }) do items.each { |item| concat(item.render) } end end end end end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems