Class: Interview::Alert

Inherits:
Text show all
Defined in:
lib/interview/controls/alert.rb

Instance Attribute Summary

Attributes inherited from Text

#html_safe, #style, #text

Attributes included from HasHtmlOptions

#html_class, #html_options

Attributes inherited from Control

#parent

Instance Method Summary collapse

Methods included from HasHtmlOptions

#initialize

Methods inherited from Control

#ancestors, #build_child, #build_with_params, #find_attribute, #find_attribute!, #initialize, #set_attributes, #set_defaults

Instance Method Details

#build(b) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/interview/controls/alert.rb', line 4

def build(b)
  html_class = @html_class.dup
  html_class << 'alert'
  html_class << "alert-#{@style}" if @style
  b.section html_class: html_class, html_options: @html_options do
    build_text(b)
    yield if block_given?
  end
end