lib/mpxj/project.rb in mpxj-4.7.6 vs lib/mpxj/project.rb in mpxj-5.0.0
- old
+ new
@@ -1,10 +1,11 @@
require 'json'
module MPXJ
# Represents a project plan
class Project
+ attr_reader :properties
attr_reader :all_resources
attr_reader :all_tasks
attr_reader :child_tasks
attr_reader :all_assignments
def initialize(file_name)
@@ -19,10 +20,11 @@
@all_assignments = []
@child_tasks = []
file = File.read(file_name)
json_data = JSON.parse(file)
+ process_properties(json_data)
process_resources(json_data)
process_tasks(json_data)
process_assignments(json_data)
end
@@ -61,9 +63,15 @@
def get_task_by_id(id)
@tasks_by_unique_id[id]
end
private
+
+ def process_properties(json_data)
+ attribute_types = json_data["property_types"]
+ attribute_values = json_data["property_values"]
+ @properties = Properties.new(self, attribute_types, attribute_values)
+ end
def process_resources(json_data)
attribute_types = json_data["resource_types"]
resources = json_data["resources"]
resources.each do |attribute_values|