Guest User

Untitled

a guest
Apr 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. class Project
  2. class << self
  3. def load(project); new(project);
  4. end
  5.  
  6. def all
  7. _projects = []
  8. Dir[Merb.root + "/config/projects/*.yml"].each { |f| _projects << File.basename(f, '.yml') }
  9. _projects
  10. end
  11. end
  12.  
  13. def initialize(project); @project = YAML::load_file(File.join(Merb.root, 'config', 'projects', "#{project.to_s}.yml"));
  14. end
  15.  
  16. def website; @project['website']
  17. end
  18.  
  19. def title; @project['title']
  20. end
  21.  
  22. def summary; @project['summary'];
  23. end
  24.  
  25. def timeframe; @project['timeframe'];
  26. end
  27. end
Add Comment
Please, Sign In to add comment