class Project < Hash def initialize value='' self[:url]='' self[:url] = value if value.is_a?(String) if(value.is_a?(Hash)) value.each{|k,v|self[k]=v} end end def get_latest_unique_id '51ed9c9d45ba3979c808740d75ba1831c85aff5d' end def self.projects_filename FileUtils.mkdir("#{Environment.dev_root}/data") if(!File.exists?("#{Environment.dev_root}/data")) "#{Environment.dev_root}/data/PROJECTS.json" end def self.load_projects projects=Project.new h=JSON.parse(IO.read(projects_filename)) if File.exists?(projects_filename) projects=Project.new(h) if File.exists?(projects_filename) projects end end