Class: BuildTool::Feature
- Inherits:
-
Object
- Object
- BuildTool::Feature
- Defined in:
- lib/build-tool/feature.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
writeonly
Sets the attribute active.
-
#description ⇒ Object
Returns the value of attribute description.
-
#environments ⇒ Object
readonly
Returns the value of attribute environments.
-
#long_description ⇒ Object
Returns the value of attribute long_description.
-
#modules ⇒ Object
readonly
Returns the value of attribute modules.
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#initialize(name = nil, parent = nil, active = true) ⇒ Feature
constructor
A new instance of Feature.
- #name ⇒ Object
- #parent ⇒ Object
- #path ⇒ Object
Constructor Details
#initialize(name = nil, parent = nil, active = true) ⇒ Feature
Returns a new instance of Feature.
11 12 13 14 15 16 17 18 19 |
# File 'lib/build-tool/feature.rb', line 11 def initialize( name = nil, parent = nil, active = true ) @name = name @active = active @parent = parent @description = nil @long_description = nil @modules = [] @environments = [] end |
Instance Attribute Details
#active=(value) ⇒ Object (writeonly)
Sets the attribute active
5 6 7 |
# File 'lib/build-tool/feature.rb', line 5 def active=(value) @active = value end |
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/build-tool/feature.rb', line 6 def description @description end |
#environments ⇒ Object (readonly)
Returns the value of attribute environments.
9 10 11 |
# File 'lib/build-tool/feature.rb', line 9 def environments @environments end |
#long_description ⇒ Object
Returns the value of attribute long_description.
7 8 9 |
# File 'lib/build-tool/feature.rb', line 7 def long_description @long_description end |
#modules ⇒ Object (readonly)
Returns the value of attribute modules.
8 9 10 |
# File 'lib/build-tool/feature.rb', line 8 def modules @modules end |
Instance Method Details
#active? ⇒ Boolean
21 22 23 24 25 26 27 |
# File 'lib/build-tool/feature.rb', line 21 def active? if @parent.nil? @active else @parent.active? && @active end end |
#name ⇒ Object
29 30 31 |
# File 'lib/build-tool/feature.rb', line 29 def name @name end |
#parent ⇒ Object
41 42 43 |
# File 'lib/build-tool/feature.rb', line 41 def parent @parent end |
#path ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/build-tool/feature.rb', line 33 def path if @parent.nil? @name else "%s/%s" % [ @parent.name, @name ] end end |