Observable<List<Contributor>> getContributors(String owner, String repo) {
GithubApi githubApi = ApiClientGenerater.generate(GithubApi.class, getBaseUrl());
return githubApi.getContributors(owner, repo)
.map(new Func1<List<Contributor>, List<Contributor>>() {
@Override
public List<Contributor> call(List<Contributor> contributors) {
Database.getDatabase()
.prepareInsertIntoContributor()
.executeAll(contributors);
return contributors;
}
});
}
public Observable<List<Contributor>> getContributors() {
return getContributors("konifar", "droidkaigi2016");
}