Sha256: be75fe90e2608d15769c18900125e1e1dfb253cf01ce55128a031ab0af767da9
Contents?: true
Size: 1.39 KB
Versions: 1
Compression:
Stored size: 1.39 KB
Contents
module MPXJ # Represents a task in a project plan class Task < Container attr_reader :assignments attr_reader :predecessors attr_reader :successors attr_reader :child_tasks def initialize(parent_project, attribute_types, attribute_values) super(parent_project, attribute_types, attribute_values) @assignments = [] @child_tasks = [] process_relations process_hierarchy end # Retrieve the parent task of this task # # @return [Task] if this task is the child of another task # @return [nil] if this is the root task def parent_task parent_project.get_task_by_unique_id(parent_task_unique_id) end private RELATION_ATTRIBUTE_TYPES = {"task_unique_id" => 17, "lag" => 6, "type" => 10} def process_relations @predecessors = process_relation_list(attribute_values["predecessors"]) @successors = process_relation_list(attribute_values["successors"]) end def process_relation_list(list) result = [] if list list.each do |attribute_values| result << Relation.new(self, RELATION_ATTRIBUTE_TYPES, attribute_values) end end result end def process_hierarchy if parent_task parent_task.child_tasks << self else parent_project.child_tasks << self end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mpxj-9.2.0 | lib/mpxj/task.rb |