Class: DesignSystem::Generic::Builders::Table

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

Overview

This class is used to provide table builder.

Direct Known Subclasses

DesignSystem::Govuk::Builders::Table

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Helpers::CssHelper

#css_class_options_merge

Methods included from Concerns::BrandDerivable

#brand

Constructor Details

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

Instance Method Details

#render_table(options = {}) {|@table| ... } ⇒ Object

Yields:

  • (@table)


8
9
10
11
12
13
14
15
16
17
18
# File 'lib/design_system/generic/builders/table.rb', line 8

def render_table(options = {})
  @table = ::DesignSystem::Components::Table.new
  yield @table

  (:div, **options) do
    safe_buffer = ActiveSupport::SafeBuffer.new
    safe_buffer.concat(table_content)

    safe_buffer
  end
end