-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPLAccount.m
40 lines (33 loc) · 890 Bytes
/
PLAccount.m
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// PLAccount.m
// Plate
//
// Created by emileleon on 2/25/14.
// Copyright (c) 2014 Plate SF. All rights reserved.
//
#import "PLAccount.h"
@implementation PLAccount
@synthesize login;
@synthesize password;
@synthesize accessToken;
- (void)readFromJSONDictionary:(NSDictionary *)d
{
self.accessToken = [d objectForKey:@"accessToken"];
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:login forKey:@"login"];
[aCoder encodeObject:password forKey:@"password"];
[aCoder encodeObject:accessToken forKey:@"accessToken"];
}
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super init];
if (self) {
[self setLogin:[aDecoder decodeObjectForKey:@"login"]];
[self setPassword:[aDecoder decodeObjectForKey:@"password"]];
[self setAccessToken:[aDecoder decodeObjectForKey:@"accessToken"]];
}
return self;
}
@end