PageRenderTime 24ms CodeModel.GetById 15ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/YouTube/GDataEntryYouTubeRating.m

http://macfuse.googlecode.com/
Objective C | 82 lines | 42 code | 22 blank | 18 comment | 1 complexity | ac523bca29a2ea6b43cd37a6388122bf MD5 | raw file
 1/* Copyright (c) 2008 Google Inc.
 2 *
 3 * Licensed under the Apache License, Version 2.0 (the "License");
 4 * you may not use this file except in compliance with the License.
 5 * You may obtain a copy of the License at
 6 *
 7 *     http://www.apache.org/licenses/LICENSE-2.0
 8 *
 9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16//
17//  GDataEntryYouTubeRating.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE
21
22#import "GDataEntryYouTubeRating.h"
23#import "GDataYouTubeConstants.h"
24
25@implementation GDataEntryYouTubeRating
26
27+ (GDataEntryYouTubeRating *)ratingEntryWithValue:(NSString *)value {
28  GDataEntryYouTubeRating *entry = [self object];
29  [entry setNamespaces:[GDataYouTubeConstants youTubeNamespaces]];
30  [entry setRating:[GDataYouTubeRating ratingWithValue:value]];
31  return entry;
32}
33
34#pragma mark -
35
36+ (NSString *)standardEntryKind {
37  return kGDataCategoryYouTubeRating;
38}
39
40+ (void)load {
41  [self registerEntryClass];
42}
43
44- (void)addExtensionDeclarations {
45  
46  [super addExtensionDeclarations];
47  
48  Class entryClass = [self class];
49
50  // YouTube element extensions
51  [self addExtensionDeclarationForParentClass:entryClass
52                                   childClass:[GDataYouTubeRating class]];
53}
54
55#if !GDATA_SIMPLE_DESCRIPTIONS
56- (NSMutableArray *)itemsForDescription {
57  
58  NSMutableArray *items = [super itemsForDescription];
59  
60  [self addToArray:items objectDescriptionIfNonNil:[self rating] withName:@"rating"];
61
62  return items;
63}
64#endif
65
66+ (NSString *)defaultServiceVersion {
67  return kGDataYouTubeDefaultServiceVersion;
68}
69
70#pragma mark -
71
72- (GDataYouTubeRating *)rating {
73  return [self objectForExtensionClass:[GDataYouTubeRating class]];
74}
75
76- (void)setRating:(GDataYouTubeRating *)obj {
77  [self setObject:obj forExtensionClass:[GDataYouTubeRating class]];
78}
79
80@end
81
82#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE