Class: AmberComponent::Configuration

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

Overview

Object which stores configuration options for this gem.

Constant Summary collapse

STIMULUS_INTEGRATIONS =

Returns:

  • (Set<Symbol>)
::Set[nil, :importmap, :webpacker, :jsbundling, :webpack, :esbuild, :rollup]
ALLOWED_STYLES =

Returns:

  • (Set<Symbol>)
::Set.new(%i[css scss sass])
ALLOWED_VIEWS =

Returns:

  • (Set<Symbol>)
::Set.new(%i[erb haml slim])

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#stimulusSymbol?

How Stimulus.js is bundled in this app. Possible values: ‘[nil, :importmap, :webpacker, :jsbundling, :webpack, :esbuild, :rollup]` `nil` indicates that stimulus should not be used (default behaviour).

Returns:

  • (Symbol, nil)


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

def stimulus
  @stimulus
end

#stylesheet_formatSymbol?

The default format that the generators will use for the stylesheets of a component. Possible values: ‘[nil, :css, :scss, :sass]`

Returns:

  • (Symbol, nil)


33
34
35
# File 'lib/amber_component/configuration.rb', line 33

def stylesheet_format
  @stylesheet_format
end

#view_formatSymbol?

The default format that the generators will use for the view/template file of a component. Possible values: ‘[nil, :erb, :haml, :slim]`

Returns:

  • (Symbol, nil)


26
27
28
# File 'lib/amber_component/configuration.rb', line 26

def view_format
  @view_format
end

Instance Method Details

#stimulus?Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/amber_component/configuration.rb', line 76

def stimulus?
  !@stimulus.nil?
end

#stimulus_importmap?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/amber_component/configuration.rb', line 81

def stimulus_importmap?
  @stimulus == :importmap
end