Class: DesignSystem::Generic::Builders::Button

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

Overview

This class provides generic methods to display button on html.

Direct Known Subclasses

DesignSystem::Govuk::Builders::Button

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_button(content_or_options = nil, options = nil) ⇒ Object



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

def render_button(content_or_options = nil, options = nil, &)
  options = prep_button_options(content_or_options, options)

  if block_given?
    button_tag(options = nil, &)
  else
    button_tag(content_or_options, options)
  end
end