Method: Bootstrap4Helper::PageHeader#initialize

Defined in:
lib/bootstrap4_helper/page_header.rb

#initialize(template, opts = {}, &block) ⇒ PageHeader

Class constructor

Parameters:

  • template (ActionView)
  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :type (symbol)
  • :id (String)
  • :class (String)
  • :data (Hash)


15
16
17
18
19
20
21
22
23
# File 'lib/bootstrap4_helper/page_header.rb', line 15

def initialize(template, opts = {}, &block)
  super(template)

  @type    = opts.fetch(:type,  nil)
  @id      = opts.fetch(:id,    uuid)
  @class   = opts.fetch(:class, '')
  @data    = opts.fetch(:data,  {})
  @content = block || proc { '' }
end