Class: FeatureRelease::Feature
- Inherits:
-
Object
- Object
- FeatureRelease::Feature
- Defined in:
- lib/feature_release/feature.rb
Instance Attribute Summary collapse
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #add_group(group) ⇒ Object
-
#initialize(name, groups_string = nil) ⇒ Feature
constructor
A new instance of Feature.
- #remove_group(group) ⇒ Object
- #to_string ⇒ Object
Constructor Details
#initialize(name, groups_string = nil) ⇒ Feature
Returns a new instance of Feature.
8 9 10 11 12 |
# File 'lib/feature_release/feature.rb', line 8 def initialize(name, groups_string=nil) @name = name @groups = [] parse_groups(groups_string) end |
Instance Attribute Details
#groups ⇒ Object
Returns the value of attribute groups.
5 6 7 |
# File 'lib/feature_release/feature.rb', line 5 def groups @groups end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/feature_release/feature.rb', line 6 def name @name end |
Instance Method Details
#add_group(group) ⇒ Object
14 15 16 |
# File 'lib/feature_release/feature.rb', line 14 def add_group(group) @groups << group.to_sym end |
#remove_group(group) ⇒ Object
18 19 20 |
# File 'lib/feature_release/feature.rb', line 18 def remove_group(group) @groups.delete(group.to_sym) end |
#to_string ⇒ Object
22 23 24 |
# File 'lib/feature_release/feature.rb', line 22 def to_string @groups.join(",") end |