ObservableStats Client

This commit is contained in:
Amy Palamountain
2014-01-11 11:06:07 +13:00
parent c14acda095
commit fd7133574b
3 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Reactive.Threading.Tasks;
namespace Octokit.Reactive
{
public class ObservableStatisticsClient : IObservableStatisticsClient
{
readonly IGitHubClient _client;
public ObservableStatisticsClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");
_client = client;
}
public IObservable<IEnumerable<Contributor>> GetContributors(string owner, string repositoryName)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
return _client.Statistics.GetContributors(owner, repositoryName).ToObservable();
}
}
}