Module: FeatureRich::ModelBehaviour::InstanceMethods
- Defined in:
- lib/feature-rich/model_behaviour.rb
Overview
ClassMethods
Instance Method Summary collapse
Instance Method Details
#features ⇒ Object
17 18 19 |
# File 'lib/feature-rich/model_behaviour.rb', line 17 def features _feature.content end |
#features=(ary) ⇒ Object
21 22 23 |
# File 'lib/feature-rich/model_behaviour.rb', line 21 def features=(ary) _feature.modify(ary) end |
#has_feature?(feature, options = {}) ⇒ Boolean
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/feature-rich/model_behaviour.rb', line 25 def has_feature?(feature, = {}) with_group(feature, [:group]) do |f| case f when Symbol, String features.features.include?(f.to_sym) when GroupFeature f.disabled? || f.subset?(features.features) || features.group_features.include?(f.name) when FeatureHandler f.disabled? || features.features.include?(f.name) end end end |