Class: TaskJuggler::AttributeDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/taskjuggler/AttributeDefinition.rb

Overview

The AttributeDefinition describes the meta information of a PropertyTreeNode attribute. It contains various information about the attribute. Based on these bits of information, the PropertySet objects generate the attribute lists for each PropertyTreeNode upon creation of the node.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, name, objClass, inheritedFromParent, inheritedFromProject, scenarioSpecific, default, userDefined = false) ⇒ AttributeDefinition

Create a new AttributeDefinition. id is the ID of the attribute. It must be unique within the PropertySet where it is used. name is a more descriptive text that will be used in report columns and the like. objClass is a reference to the class (not the object itself) of the attribute. The possible classes all have names ending in Attribute. inheritedFromParent is a boolean flag that needs to be true if the node can inherit the setting from the attribute of the parent node. inheritedFromProject is a boolen flag that needs to be true if the node can inherit the setting from an attribute in the global scope. scenarioSpecific is a boolean flag that is set to true if the attribute can have different values for each scenario. default is the default value that is set upon creation of the attribute.



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/taskjuggler/AttributeDefinition.rb', line 36

def initialize(id, name, objClass, inheritedFromParent, inheritedFromProject,
               scenarioSpecific, default, userDefined = false)
  @id = id
  @name = name
  @objClass = objClass
  @inheritedFromParent = inheritedFromParent
  @inheritedFromProject = inheritedFromProject
  @scenarioSpecific = scenarioSpecific
  @default = default
  @userDefined = userDefined
  # Prevent objects from being deep copied.
  freeze
end

Instance Attribute Details

#defaultObject (readonly)

Returns the value of attribute default.



21
22
23
# File 'lib/taskjuggler/AttributeDefinition.rb', line 21

def default
  @default
end

#idObject (readonly)

Returns the value of attribute id.



21
22
23
# File 'lib/taskjuggler/AttributeDefinition.rb', line 21

def id
  @id
end

#inheritedFromParentObject (readonly)

Returns the value of attribute inheritedFromParent.



21
22
23
# File 'lib/taskjuggler/AttributeDefinition.rb', line 21

def inheritedFromParent
  @inheritedFromParent
end

#inheritedFromProjectObject (readonly)

Returns the value of attribute inheritedFromProject.



21
22
23
# File 'lib/taskjuggler/AttributeDefinition.rb', line 21

def inheritedFromProject
  @inheritedFromProject
end

#nameObject (readonly)

Returns the value of attribute name.



21
22
23
# File 'lib/taskjuggler/AttributeDefinition.rb', line 21

def name
  @name
end

#objClassObject (readonly)

Returns the value of attribute objClass.



21
22
23
# File 'lib/taskjuggler/AttributeDefinition.rb', line 21

def objClass
  @objClass
end

#scenarioSpecificObject (readonly)

Returns the value of attribute scenarioSpecific.



21
22
23
# File 'lib/taskjuggler/AttributeDefinition.rb', line 21

def scenarioSpecific
  @scenarioSpecific
end

#userDefinedObject (readonly)

Returns the value of attribute userDefined.



21
22
23
# File 'lib/taskjuggler/AttributeDefinition.rb', line 21

def userDefined
  @userDefined
end