This lab builds on the Rails Github API lab. You're provided with code from that lab.
-
Create a new model
GithubRepo
inapp/models/github_repo.rb
. Since you're not storingGithubRepo
in a database, this class does not need to inherit from Active Record. Create the file manually โ usingrails g model
will automatically inherit from Active Record and create a migration. Build out theGithubRepo
class to pass the model tests. -
Move authentication from your controller to your service objects.
-
Implement the
#initialize
method for yourGithubService
objects. -
Move the rest of your API calls into the
GithubService
object. Analyze the test requirements, and get the application working.
View Working with APIs on Learn.co and start learning to code for free.