Class: Trajectory::Api

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/trajectory/data_access/api.rb

Class Method Summary collapse

Class Method Details

.ideas_for_project(project) ⇒ JSON

Returns a json array of all ideas (of the given project) attributes from trajectory API.

Returns:

  • (JSON)

    a json array of all ideas (of the given project) attributes from trajectory API



31
32
33
# File 'lib/trajectory/data_access/api.rb', line 31

def ideas_for_project(project)
  get_json("/projects/#{project.keyword}/ideas.json")
end

.iterations_for_project(project) ⇒ JSON

Returns a json array of all iterations (of the given project) attributes from trajectory API.

Returns:

  • (JSON)

    a json array of all iterations (of the given project) attributes from trajectory API



26
27
28
# File 'lib/trajectory/data_access/api.rb', line 26

def iterations_for_project(project)
  get_json("/projects/#{project.keyword}/iterations.json")
end

.projectsJSON

Returns a json array of all projects attributes from trajectory API.

Returns:

  • (JSON)

    a json array of all projects attributes from trajectory API



10
11
12
# File 'lib/trajectory/data_access/api.rb', line 10

def projects
  get_json("/projects.json")
end

.stories_for_project(project) ⇒ JSON

Returns a json array of all stories (of the given project) attributes from trajectory API.

Returns:

  • (JSON)

    a json array of all stories (of the given project) attributes from trajectory API



20
21
22
23
# File 'lib/trajectory/data_access/api.rb', line 20

def stories_for_project(project)
  get_json("/projects/#{project.keyword}/stories/completed.json")['stories'] +
  get_json("/projects/#{project.keyword}/stories.json")['stories']
end

.updates_for_project(project, since) ⇒ JSON

Returns a json array of all updates (of the given project) attributes from trajectory API.

Returns:

  • (JSON)

    a json array of all updates (of the given project) attributes from trajectory API



36
37
38
# File 'lib/trajectory/data_access/api.rb', line 36

def updates_for_project(project, since)
  get_json("/projects/#{project.keyword}/updates.json?since=#{since.to_s}")
end

.users_for_project(project) ⇒ JSON

Returns a json array of all users (of the given project) attributes from trajectory API.

Returns:

  • (JSON)

    a json array of all users (of the given project) attributes from trajectory API



15
16
17
# File 'lib/trajectory/data_access/api.rb', line 15

def users_for_project(project)
  get_json("/projects/#{project.keyword}/users.json")
end