Class: UI::Configuration

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

Overview

Configuration

Allows users to override automatic gem detection for Phlex and ViewComponent.

Examples:

Force enable (useful for testing unsupported versions)

UI.configure do |c|
  c.enable_phlex = true
  c.enable_view_component = true
end

Force disable (useful when gems exist but shouldn’t be used)

UI.configure do |c|
  c.enable_phlex = false
  c.enable_view_component = false
end

Let automatic detection decide (default)

# Don't call configure, or set to nil
UI.configure do |c|
  c.enable_phlex = nil  # auto-detect
  c.enable_view_component = nil  # auto-detect
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



35
36
37
38
# File 'lib/ui/configuration.rb', line 35

def initialize
  @enable_phlex = nil
  @enable_view_component = nil
end

Instance Attribute Details

#enable_phlexBoolean?

Returns nil = auto-detect, true = force enable, false = force disable.

Returns:

  • (Boolean, nil)

    nil = auto-detect, true = force enable, false = force disable



30
31
32
# File 'lib/ui/configuration.rb', line 30

def enable_phlex
  @enable_phlex
end

#enable_view_componentBoolean?

Returns nil = auto-detect, true = force enable, false = force disable.

Returns:

  • (Boolean, nil)

    nil = auto-detect, true = force enable, false = force disable



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

def enable_view_component
  @enable_view_component
end