Class: StimulusPlumbers::Configuration

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

Constant Summary collapse

DEFAULT_LOG_FORMATTER =
->(message) { "[StimulusPlumbers] #{message}" }
THEME_KLASS_FORMATTER =
->(type) { "StimulusPlumbers::Themes::#{type.to_s.classify}Theme" }

Instance Method Summary collapse

Instance Method Details

#log_formatterObject



19
20
21
# File 'lib/stimulus_plumbers/configuration.rb', line 19

def log_formatter
  @log_formatter ||= DEFAULT_LOG_FORMATTER
end

#log_formatter=(callable) ⇒ Object

Raises:

  • (ArgumentError)


23
24
25
26
27
# File 'lib/stimulus_plumbers/configuration.rb', line 23

def log_formatter=(callable)
  raise ArgumentError, "log_formatter must respond to #call" unless callable.respond_to?(:call)

  @log_formatter = callable
end

#themeObject



11
12
13
# File 'lib/stimulus_plumbers/configuration.rb', line 11

def theme
  @theme ||= build_theme(:tailwind)
end

#theme=(value) ⇒ Object



15
16
17
# File 'lib/stimulus_plumbers/configuration.rb', line 15

def theme=(value)
  @theme = build_theme(value)
end