Class: MppReader::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/mpp_reader/task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTask

Returns a new instance of Task.



9
10
11
12
13
# File 'lib/mpp_reader/task.rb', line 9

def initialize
  @children = []
  @predecessors = []
  @successors = []
end

Instance Attribute Details

#activeObject

Returns the value of attribute active.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def active
  @active
end

#childrenObject (readonly)

Returns the value of attribute children.



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

def children
  @children
end

#constraint_dateObject

Returns the value of attribute constraint_date.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def constraint_date
  @constraint_date
end

#constraint_typeObject

Returns the value of attribute constraint_type.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def constraint_type
  @constraint_type
end

#durationObject

Returns the value of attribute duration.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def duration
  @duration
end

#finishObject

Returns the value of attribute finish.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def finish
  @finish
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def id
  @id
end

#manualObject

Returns the value of attribute manual.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def manual
  @manual
end

#milestoneObject

Returns the value of attribute milestone.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def milestone
  @milestone
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def name
  @name
end

#notesObject

Returns the value of attribute notes.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def notes
  @notes
end

#outline_levelObject

Returns the value of attribute outline_level.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def outline_level
  @outline_level
end

#parentObject

Returns the value of attribute parent.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def parent
  @parent
end

#percent_completeObject

Returns the value of attribute percent_complete.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def percent_complete
  @percent_complete
end

#predecessorsObject (readonly)

Returns the value of attribute predecessors.



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

def predecessors
  @predecessors
end

#startObject

Returns the value of attribute start.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def start
  @start
end

#successorsObject (readonly)

Returns the value of attribute successors.



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

def successors
  @successors
end

#unique_idObject

Returns the value of attribute unique_id.



3
4
5
# File 'lib/mpp_reader/task.rb', line 3

def unique_id
  @unique_id
end

Instance Method Details

#constrained?Boolean

True when the constraint actually pins the task somewhere. The default (as_soon_as_possible) and as_late_as_possible carry no date and express a scheduling preference, not a fixed point; the other six do.

Returns:

  • (Boolean)


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

def constrained?
  !constraint_date.nil? &&
    !%i[as_soon_as_possible as_late_as_possible].include?(constraint_type)
end

#milestone?Boolean

Returns:

  • (Boolean)


15
# File 'lib/mpp_reader/task.rb', line 15

def milestone? = !!@milestone

#summaryObject Also known as: summary?

A summary task is one with subtasks (MS Project derives this the same way).



27
# File 'lib/mpp_reader/task.rb', line 27

def summary = !@children.empty?