csharp/aabiryukov/CryptoMarketApi/Api/OKCoinApi/Ticker.cs

Ticker.cs
using Newtonsoft.Json.Linq;
using System;

namespace OKCoin
{
	public clast Ticker
	{
		public decimal Buy { get; private set; }
		public decimal High { get; private set; }
		public decimal Last { get; private set; }
		public decimal Low { get; private set; }
		public decimal Sell { get; private set; }
		public decimal Volume { get; private set; }
		
		public DateTime ServerTime { get; private set; }
		public static Ticker ReadFromJObject(JToken jobj) {
			if ( jobj == null )
				throw new ArgumentNullException("jobj");

			var o = jobj["ticker"];

			if (o == null)
				return null;

			var ticker = new Ticker
			{
				Buy = o.Value("buy"),
				High = o.Value("high"),
				Last = o.Value("last"),
				Low = o.Value("low"),
				Sell = o.Value("sell"),
				Volume = o.Value("vol"),
				ServerTime = UnixTime.ConvertToDateTime(jobj["date"].Value()),
			};

			return ticker;
		}
	}
}