Method: Bootstrap4Helper::Spinner#initialize

Defined in:
lib/bootstrap4_helper/spinner.rb

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

Note:

The different support types are: ‘:border` and `:grow`

Class constructor

Parameters:

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

Options Hash (opts):

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


17
18
19
20
21
22
23
24
25
# File 'lib/bootstrap4_helper/spinner.rb', line 17

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

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