Class: FeatureRelease::Feature

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#groupsObject

Returns the value of attribute groups.



5
6
7
# File 'lib/feature_release/feature.rb', line 5

def groups
  @groups
end

#nameObject (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_stringObject



22
23
24
# File 'lib/feature_release/feature.rb', line 22

def to_string
  @groups.join(",")
end