Class: FeatureToggles::Feature

Inherits:
Object
  • Object
show all
Defined in:
lib/feature_toggles/feature.rb

Class Method Summary collapse

Class Method Details

.is_enabled?(feature_name, user_type = nil) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
8
9
# File 'lib/feature_toggles/feature.rb', line 3

def self.is_enabled?(feature_name, user_type=nil)
  if user_type && has_user_specific_permission?(feature_name, user_type)
    enabled_for_user?(feature_name, user_type)
  else
    enabled_generally?(feature_name)
  end
end