Class: DesignSystem::Govuk::Builders::Callout

Inherits:
DesignSystem::Generic::Builders::Callout show all
Defined in:
lib/design_system/govuk/builders/callout.rb

Overview

This generates html for rendering warning callout for Govuk

Instance Method Summary collapse

Methods inherited from DesignSystem::Generic::Builders::Base

#initialize

Methods included from Helpers::CssHelper

#css_class_options_merge

Methods included from DesignSystem::Generic::Builders::Concerns::BrandDerivable

#brand

Constructor Details

This class inherits a constructor from DesignSystem::Generic::Builders::Base

Instance Method Details

#render_callout(label, body) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/design_system/govuk/builders/callout.rb', line 8

def render_callout(label, body)
  safe_buffer = ActiveSupport::SafeBuffer.new
  (:div, class: "#{brand}-warning-text") do
    safe_buffer.concat((:span, '!', class: "#{brand}-warning-text__icon", 'aria-hidden': 'true'))
    safe_buffer.concat(render_body(label, body))
  end
end