Module: Lookbook::Features

Defined in:
lib/lookbook/features.rb

Constant Summary collapse

EXPERIMENTAL_FEATURES =
[]

Class Method Summary collapse

Class Method Details

.enabledObject



14
15
16
17
18
19
20
21
22
# File 'lib/lookbook/features.rb', line 14

def self.enabled
  if Lookbook.config.experimental_features == true
    EXPERIMENTAL_FEATURES
  elsif Lookbook.config.experimental_features.blank?
    []
  else
    Lookbook.config.experimental_features.map(&:to_sym)
  end
end

.enabled?(name) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/lookbook/features.rb', line 9

def self.enabled?(name)
  return true unless experimental_feature?(name)
  enabled.include?(name.to_sym)
end

.experimental_feature?(name) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/lookbook/features.rb', line 5

def self.experimental_feature?(name)
  EXPERIMENTAL_FEATURES.include?(name.to_sym)
end