Class: FFeature::Feature
- Inherits:
-
Object
- Object
- FFeature::Feature
- Defined in:
- lib/ffeature/feature.rb
Instance Method Summary collapse
- #enabled?(user = nil) ⇒ Boolean
-
#initialize(feature) ⇒ Feature
constructor
A new instance of Feature.
Constructor Details
#initialize(feature) ⇒ Feature
Returns a new instance of Feature.
6 7 8 |
# File 'lib/ffeature/feature.rb', line 6 def initialize(feature) @feature = feature end |
Instance Method Details
#enabled?(user = nil) ⇒ Boolean
10 11 12 13 14 15 16 17 18 |
# File 'lib/ffeature/feature.rb', line 10 def enabled?(user = nil) return true if FFeature.dev_mode if flipper_user?(user) FFeature.flipper[feature].enabled?(user.to_model) else FFeature.flipper[feature].enabled? end end |