Class: Bootstrap4Helper::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/bootstrap4_helper/configuration.rb

Overview

TODO:

Build a better, more comprehensive system.

Simple configuration object for setting options for the gem.

Constant Summary collapse

DEFAULT_SETTINGS =
{
  autoload_in_views: true,
  card_title:        :h5,
  card_text:         :p,
  accordion_header:  :h5,
  badge:             :span,
  page_header:       :h1
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(_args = {}) ⇒ ClassName

Class constructor

Parameters:

  • _args (Hash) (defaults to: {})


23
24
25
# File 'lib/bootstrap4_helper/configuration.rb', line 23

def initialize(_args = {})
  DEFAULT_SETTINGS.each { |key, value| instance_variable_set("@#{key}", value) }
end

Instance Method Details

#autoload_in_views?Boolean

Simple predicate method

Returns:

  • (Boolean)


31
32
33
# File 'lib/bootstrap4_helper/configuration.rb', line 31

def autoload_in_views?
  @autoload_in_views
end