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
- .create(&block) ⇒ Object
- .create_task(name, &block) ⇒ Object
-
.New ⇒ Object
Create a new Gantt chart from scratch.
-
.Open(file) ⇒ Object
Create a new Gantt chart from a GanttProject
.gan
file. -
.Resource(args) ⇒ Object
Create a new Gantt Resource.
-
.Task(args) ⇒ Object
Create a new task.
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 |
.New ⇒ Object
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 |