Peter d153fe0f21 Add 'submodules/LegacyComponents/' from commit 'd5594346161c1b7f203d1e87068bbe77bcaac019'
git-subtree-dir: submodules/LegacyComponents
git-subtree-mainline: 608630530451e02e5aec48389d144dbf7a3625b9
git-subtree-split: d5594346161c1b7f203d1e87068bbe77bcaac019
2019-06-11 18:51:15 +01:00

43 lines
1.2 KiB
Objective-C
Executable File

//
// CBCoubAuthorVO.m
// Coub
//
// Created by Tikhonenko Pavel on 21/11/2013.
// Copyright (c) 2013 Coub. All rights reserved.
//
#import "CBCoubAuthorVO.h"
@implementation CBCoubAuthorVO
+ (CBCoubAuthorVO *)coubAuthorWithAttributes:(NSDictionary *)attributes
{
CBCoubAuthorVO *author = [CBCoubAuthorVO new];
author.avatarURL = attributes[@"avatar"];
author.largeAvatarURL = attributes[@"large_avatar"];
author.followersCount = [attributes[@"followers_count"] integerValue];
author.userId = [attributes[@"id"] stringValue];
author.name = attributes[@"name"];
author.permalink = attributes[@"permalink"];
author.viewsCount = [attributes[@"views_count"] integerValue];
//author.viewsCount;
return author;
}
//+ (CBCoubAuthorVO *)currentUser
//{
// CBUserNew *curUser = [CBUserNew currentUser];
//
// CBCoubAuthorVO *author = [CBCoubAuthorVO new];
// author.avatarURL = curUser.mediumAvatar;
// author.largeAvatarURL = curUser.largeAvatar;
// author.followersCount = curUser.followerCount;
// author.userId = curUser.coubID;
// author.name = curUser.fullName;
// author.permalink = curUser.permalink;
// author.viewsCount = curUser.viewsCount;
// return author;
//}
@end