Class: FeatureRich::GroupFeature
- Inherits:
-
FeatureHandler
- Object
- FeatureHandler
- FeatureRich::GroupFeature
- Defined in:
- lib/feature-rich/group_feature.rb
Instance Attribute Summary collapse
-
#sets ⇒ Object
Returns the value of attribute sets.
Attributes inherited from FeatureHandler
Instance Method Summary collapse
- #configure(&block) ⇒ Object
- #feature(name, options = {}) ⇒ Object
-
#initialize(group_name, options = {}) ⇒ GroupFeature
constructor
A new instance of GroupFeature.
- #names ⇒ Object
- #subset?(ary) ⇒ Boolean
Methods inherited from FeatureHandler
Constructor Details
#initialize(group_name, options = {}) ⇒ GroupFeature
Returns a new instance of GroupFeature.
6 7 8 9 |
# File 'lib/feature-rich/group_feature.rb', line 6 def initialize(group_name, = {}) super @sets = [] end |
Instance Attribute Details
#sets ⇒ Object
Returns the value of attribute sets.
4 5 6 |
# File 'lib/feature-rich/group_feature.rb', line 4 def sets @sets end |
Instance Method Details
#configure(&block) ⇒ Object
23 24 25 26 |
# File 'lib/feature-rich/group_feature.rb', line 23 def configure(&block) instance_exec(&block) self end |
#feature(name, options = {}) ⇒ Object
19 20 21 |
# File 'lib/feature-rich/group_feature.rb', line 19 def feature(name, = {}) sets << FeatureRich::FeatureHandler.new(name.to_sym, ) end |
#names ⇒ Object
15 16 17 |
# File 'lib/feature-rich/group_feature.rb', line 15 def names sets.map(&:name) end |
#subset?(ary) ⇒ Boolean
11 12 13 |
# File 'lib/feature-rich/group_feature.rb', line 11 def subset?(ary) (names & ary) == names end |