Class: BuildTool::Feature

Inherits:
Object
  • Object
show all
Defined in:
lib/build-tool/feature.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Parameters:

  • value

    the value to set the attribute active to.



5
6
7
# File 'lib/build-tool/feature.rb', line 5

def active=(value)
  @active = value
end

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'lib/build-tool/feature.rb', line 6

def description
  @description
end

#environmentsObject (readonly)

Returns the value of attribute environments.



9
10
11
# File 'lib/build-tool/feature.rb', line 9

def environments
  @environments
end

#long_descriptionObject

Returns the value of attribute long_description.



7
8
9
# File 'lib/build-tool/feature.rb', line 7

def long_description
  @long_description
end

#modulesObject (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

Returns:

  • (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

#nameObject



29
30
31
# File 'lib/build-tool/feature.rb', line 29

def name
    @name
end

#parentObject



41
42
43
# File 'lib/build-tool/feature.rb', line 41

def parent
    @parent
end

#pathObject



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