Class: Gantty::Task

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(t) ⇒ Task

Returns a new instance of Task.



41
42
43
44
45
46
47
48
49
# File 'lib/gantty.rb', line 41

def initialize t
  @name = t.attributes["name"]
  @start = Date.strptime(t.attributes["start"])
  @duration = t.attributes["duration"].to_i
  @end = @start + @duration
  @percent_complete = t.attributes["complete"]
  @coordinators = []
  @id = t.attributes["id"].to_i
end

Instance Attribute Details

#coordinatorsObject

Returns the value of attribute coordinators.



38
39
40
# File 'lib/gantty.rb', line 38

def coordinators
  @coordinators
end

#durationObject

Returns the value of attribute duration.



38
39
40
# File 'lib/gantty.rb', line 38

def duration
  @duration
end

#endObject

Returns the value of attribute end.



38
39
40
# File 'lib/gantty.rb', line 38

def end
  @end
end

#idObject (readonly)

Returns the value of attribute id.



39
40
41
# File 'lib/gantty.rb', line 39

def id
  @id
end

#nameObject

Returns the value of attribute name.



38
39
40
# File 'lib/gantty.rb', line 38

def name
  @name
end

#percent_completeObject

Returns the value of attribute percent_complete.



38
39
40
# File 'lib/gantty.rb', line 38

def percent_complete
  @percent_complete
end

#startObject

Returns the value of attribute start.



38
39
40
# File 'lib/gantty.rb', line 38

def start
  @start
end