summaryrefslogtreecommitdiff
path: root/Juick/Model/User.m
blob: 2401c7e128b2a517ad0a8bdb02ba1d0eee2f860d (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
//
//  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];
    return user;
}

@end