Module: Gantty

Defined in:
lib/gantty.rb

Defined Under Namespace

Classes: GanttChart, Resource, Task

Constant Summary collapse

PRIORITY =

A dual-lookup hash for priority conversions between GanttProject files and Gantty tasks.

{ :low => 0, :normal => 1, :medium => 1, :high => 2, 0 => :low, 1 => :normal, 2 => :high }
HARDNESS =

Hardness links of related tasks.

{ :rubber => "Rubber", :strong => "Strong" }
DEPENDS =

A lookup hash for converstions between GanttProject file priorities and the functions that dependencies of that value will call.

{ 1 => :add_starts_with, 2 => :add_starts_after, 3 => :add_finishes_with, 4 => :add_finishes_before }
REVERSE_DEPENDS =

A reverse-lookup hash for dependency types between Gantty and GanttProject.

{ :starts_with => 1, :starts_after => 2, :finishes_with => 3, :finishes_before => 4 }

Class Method Summary collapse

Class Method Details

.create(&block) ⇒ Object



56
57
58
59
60
# File 'lib/gantty.rb', line 56

def self.create(&block)
  gantt = GanttChart.new
  gantt.instance_eval(&block)
  return gantt
end

.create_task(name, &block) ⇒ Object



62
63
64
65
66
# File 'lib/gantty.rb', line 62

def self.create_task(name, &block)
  task = Task.new(name)
  task.instance_eval(&block)
  return task
end

.NewObject

Create a new Gantt chart from scratch.

gantt = Gantty::New()


42
43
44
# File 'lib/gantty.rb', line 42

def self.New
  return GanttChart.new
end

.Open(file) ⇒ Object

Create a new Gantt chart from a GanttProject .gan file.

gantt = Gantty::Open('~/charts/example.gan')


35
36
37
# File 'lib/gantty.rb', line 35

def self.Open file
  return GanttChart.new(file)
end

.Resource(args) ⇒ Object

Create a new Gantt Resource.

bob = Gantty::Resource "Bob Beta"
bob = Gantty::Resource :name => "Bob Beta"

Only setting :name is supported in the hash instantiation right now.



52
53
54
# File 'lib/gantty.rb', line 52

def self.Resource args
  return Resource.new(args)
end

.Task(args) ⇒ Object

Create a new task.

task = Gantty::Task "New Task Name"
task = Gantty::Task :name => "New Task Name"

Only setting :name is supported in the hash instantiation right now.



28
29
30
# File 'lib/gantty.rb', line 28

def self.Task args
  return Task.new(args)
end