Class: DesignSystem::Generic::Builders::Callout

Inherits:
Base
  • Object
show all
Defined in:
lib/design_system/generic/builders/callout.rb

Overview

This generates html for rendering warning callout to help users identify and understand warning content on the page, even if they do not read the whole page.

Instance Method Summary collapse

Methods inherited from 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/generic/builders/callout.rb', line 8

def render_callout(label, body)
  safe_buffer = ActiveSupport::SafeBuffer.new
  (:div, class: "#{brand}-warning-callout") do
    safe_buffer.concat(render_label(label))
    safe_buffer.concat((:p, body))
  end
end