summaryrefslogtreecommitdiff
path: root/Juick/Model/User.m
blob: 65f7fe3dbf9d90b2178c9bec483c7eab6ecb61bf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//
//  User.m
//  Juick
//
//  Created by Vitaly on 01.02.14.
//  Copyright (c) 2014 com.juick. All rights reserved.
//

#import "User.h"

@implementation User

+ (User *) fromJSON:(NSDictionary *)jsonData {
    User *user = [User new];
    user.uid = jsonData[@"uid"];
    user.uname = jsonData[@"uname"];
    user.avatar = jsonData[@"avatar"];
    user.token = jsonData[@"hash"];
    user.uri = jsonData[@"uri"];
    user.unreadCount = [jsonData[@"messagesCount"] integerValue];
    user.premium = jsonData[@"premium"];
    return user;
}

@end