Permalink
Browse files

Add journal property to SZNAltmetricArticle

  • Loading branch information...
1 parent f35ce9a commit c1f0c192bbfda75db72b61b6354f937b9ed66638 @vtourraine vtourraine committed Apr 4, 2013
@@ -32,6 +32,7 @@ - (void)testArticleFromRespondeDictionary
@"score" : @(42),
@"images" : @{@"small" : @"http://test.com/small.jpg", @"medium" : @"http://test.com/medium.jpg", @"large" : @"http://test.com/large.jpg"},
@"is_oa" : @(YES),
+ @"journal": @"Jou",
@"title" : @"Article",
@"details_url" : @"http://test.com/article/details",
@"url" : @"http://test.com/article"}];
@@ -58,6 +59,7 @@ - (void)testArticleFromRespondeDictionary
STAssertEqualObjects(article.imageMediumURL.absoluteString, @"http://test.com/medium.jpg", @"Image medium URL not extracted");
STAssertEqualObjects(article.imageLargeURL.absoluteString, @"http://test.com/large.jpg", @"Image large URL not extracted");
STAssertEqualObjects(article.openAccess, @(YES), @"Open Access not extracted");
+ STAssertEqualObjects(article.journal, @"Jou", @"Journal not extracted");
STAssertEqualObjects(article.title, @"Article", @"Title not extracted");
STAssertEqualObjects(article.articleURL.absoluteString, @"http://test.com/article", @"Article URL not extracted");
STAssertEqualObjects(article.detailsURL.absoluteString, @"http://test.com/article/details", @"Details URL not extracted");
@@ -119,6 +119,11 @@
*/
@property (strong, nonatomic) NSNumber *openAccess;
+/**
+ The journal of the article.
+ */
+@property (copy, nonatomic) NSString *journal;
+
/**
The URL of the article.
*/
@@ -48,6 +48,7 @@ + (SZNAltmetricArticle *)articleWithAPIResponseObject:(id)responseObject
article.imageMediumURL = [NSURL URLWithString:responseObject[@"images"][@"medium"]];
article.imageSmallURL = [NSURL URLWithString:responseObject[@"images"][@"small"]];
article.openAccess = responseObject[@"is_oa"];
+ article.journal = responseObject[@"journal"];
article.title = responseObject[@"title"];
article.articleURL = [NSURL URLWithString:responseObject[@"url"]];
article.detailsURL = [NSURL URLWithString:responseObject[@"details_url"]];

0 comments on commit c1f0c19

Please sign in to comment.