Create observable commits client

This commit is contained in:
John Nye
2013-11-05 08:23:10 +00:00
parent f8e06c0174
commit 162a45e446
12 changed files with 111 additions and 8 deletions

View File

@@ -0,0 +1,25 @@
using System;
using System.Reactive.Threading.Tasks;
namespace Octokit.Reactive
{
public class ObservableCommitsClient : IObservableCommitsClient
{
readonly ICommitsClient _client;
public ObservableCommitsClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");
_client = client.GitDatabase.Commit;
}
public IObservable<Commit> Get(string owner, string name, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
return _client.Get(owner, name, reference).ToObservable();
}
}
}