Class: MPXJ::Task

Inherits:
Container show all
Defined in:
lib/mpxj/task.rb

Overview

Represents a task in a project plan

Instance Attribute Summary collapse

Attributes inherited from Container

#parent_project

Instance Method Summary collapse

Methods inherited from Container

#method_missing

Constructor Details

#initialize(parent_project, attribute_types, attribute_values) ⇒ Task

Returns a new instance of Task.



9
10
11
12
13
14
15
# File 'lib/mpxj/task.rb', line 9

def initialize(parent_project, attribute_types, attribute_values)
  super(parent_project, attribute_types, attribute_values)
  @assignments = []
  @child_tasks = []
  process_relations
  process_hierarchy
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MPXJ::Container

Instance Attribute Details

#assignmentsObject (readonly)

Returns the value of attribute assignments.



4
5
6
# File 'lib/mpxj/task.rb', line 4

def assignments
  @assignments
end

#child_tasksObject (readonly)

Returns the value of attribute child_tasks.



7
8
9
# File 'lib/mpxj/task.rb', line 7

def child_tasks
  @child_tasks
end

#predecessorsObject (readonly)

Returns the value of attribute predecessors.



5
6
7
# File 'lib/mpxj/task.rb', line 5

def predecessors
  @predecessors
end

#successorsObject (readonly)

Returns the value of attribute successors.



6
7
8
# File 'lib/mpxj/task.rb', line 6

def successors
  @successors
end

Instance Method Details

#parent_taskTask?

Retrieve the parent task of this task

Returns:

  • (Task)

    if this task is the child of another task

  • (nil)

    if this is the root task



21
22
23
# File 'lib/mpxj/task.rb', line 21

def parent_task
  parent_project.get_task_by_unique_id(parent_task_unique_id)
end