Module: Trajectory::DataStore
Instance Method Summary collapse
-
#find_iteration_of_project_with_id(project, iteration_id) ⇒ Iteration, false
Fetches a iteration of a given project by id.
-
#find_project_by_id(id) ⇒ Project, false
Fetches a project by id in the collection of accessible projects.
-
#find_user_of_project_with_id(project, user_id) ⇒ User, false
Fetches a user of a given project by id.
-
#ideas_for_project(project) ⇒ Ideas
Fetches all ideas of a given project.
-
#iterations_for_project(project) ⇒ Iterations
Fetches all iterations of a given project.
-
#projects ⇒ Projects
The collection of projects of the trajectory account.
-
#stories_for_project(project) ⇒ Stories
Fetches all stories of a given project.
-
#updates_for_project(project, since = DateTime.now) ⇒ Ideas
Fetches all updates of a given project since a given date.
-
#users_for_project(project) ⇒ Users
The collection of users of the trajectory account.
Instance Method Details
#find_iteration_of_project_with_id(project, iteration_id) ⇒ Iteration, false
Fetches a iteration of a given project by id
75 76 77 |
# File 'lib/trajectory/data_access/data_store.rb', line 75 def find_iteration_of_project_with_id(project, iteration_id) project.find_iteration_by_id(iteration_id) end |
#find_project_by_id(id) ⇒ Project, false
Fetches a project by id in the collection of accessible projects
49 50 51 |
# File 'lib/trajectory/data_access/data_store.rb', line 49 def find_project_by_id(id) projects.find_by_id(id) end |
#find_user_of_project_with_id(project, user_id) ⇒ User, false
Fetches a user of a given project by id
58 59 60 |
# File 'lib/trajectory/data_access/data_store.rb', line 58 def find_user_of_project_with_id(project, user_id) project.find_user_by_id(user_id) end |
#ideas_for_project(project) ⇒ Ideas
Fetches all ideas of a given project
27 28 29 |
# File 'lib/trajectory/data_access/data_store.rb', line 27 def ideas_for_project(project) Ideas.from_json project, Api.ideas_for_project(project) end |
#iterations_for_project(project) ⇒ Iterations
Fetches all iterations of a given project
66 67 68 |
# File 'lib/trajectory/data_access/data_store.rb', line 66 def iterations_for_project(project) Iterations.from_json project, Api.iterations_for_project(project) end |
#projects ⇒ Projects
Returns the collection of projects of the trajectory account.
6 7 8 |
# File 'lib/trajectory/data_access/data_store.rb', line 6 def projects @projects ||= Projects.from_json(Api.projects) end |
#stories_for_project(project) ⇒ Stories
Fetches all stories of a given project
19 20 21 |
# File 'lib/trajectory/data_access/data_store.rb', line 19 def stories_for_project(project) Stories.from_json project, Api.stories_for_project(project) end |
#updates_for_project(project, since = DateTime.now) ⇒ Ideas
Fetches all updates of a given project since a given date
36 37 38 39 40 41 42 43 |
# File 'lib/trajectory/data_access/data_store.rb', line 36 def updates_for_project(project, since = DateTime.now) updates = Api.updates_for_project(project, since).symbolize_keys! stories = Stories.from_json(project, updates[:stories]) iterations = Iterations.from_json(project, updates[:iterations]) Update.new(stories, iterations) end |
#users_for_project(project) ⇒ Users
Returns the collection of users of the trajectory account.
11 12 13 |
# File 'lib/trajectory/data_access/data_store.rb', line 11 def users_for_project(project) Users.from_json Api.users_for_project(project) end |