Class: Nozbe::ProjectsListApiCall
- Defined in:
- lib/nozbe/project.rb
Overview
This class is used internaly by the Project class to make the API call that list all projects
Constant Summary
Constants inherited from ApiCall
Instance Attribute Summary
Attributes inherited from ApiCall
#action, #parameters, #required_parameters
Instance Method Summary collapse
-
#parse(json) ⇒ Object
Parse the JSON response, and return an Array of Project instances.
Methods inherited from ApiCall
action, #build_query_string, #build_request_path, #call, #do_request, #initialize, #url_encode
Constructor Details
This class inherits a constructor from Nozbe::ApiCall
Instance Method Details
#parse(json) ⇒ Object
Parse the JSON response, and return an Array of Project instances
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/nozbe/project.rb', line 69 def parse(json) projects = super(json) projects.collect do |raw_project| project = Project.new project.id = raw_project["id"] project.name = raw_project["name"] project.count = raw_project["count"] project end end |