/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. // GDataEntryYouTubeRating.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE
  19. #import "GDataEntryYouTubeRating.h"
  20. #import "GDataYouTubeConstants.h"
  21. @implementation GDataEntryYouTubeRating
  22. + (GDataEntryYouTubeRating *)ratingEntryWithValue:(NSString *)value {
  23. GDataEntryYouTubeRating *entry = [self object];
  24. [entry setNamespaces:[GDataYouTubeConstants youTubeNamespaces]];
  25. [entry setRating:[GDataYouTubeRating ratingWithValue:value]];
  26. return entry;
  27. }
  28. #pragma mark -
  29. + (NSString *)standardEntryKind {
  30. return kGDataCategoryYouTubeRating;
  31. }
  32. + (void)load {
  33. [self registerEntryClass];
  34. }
  35. - (void)addExtensionDeclarations {
  36. [super addExtensionDeclarations];
  37. Class entryClass = [self class];
  38. // YouTube element extensions
  39. [self addExtensionDeclarationForParentClass:entryClass
  40. childClass:[GDataYouTubeRating class]];
  41. }
  42. #if !GDATA_SIMPLE_DESCRIPTIONS
  43. - (NSMutableArray *)itemsForDescription {
  44. NSMutableArray *items = [super itemsForDescription];
  45. [self addToArray:items objectDescriptionIfNonNil:[self rating] withName:@"rating"];
  46. return items;
  47. }
  48. #endif
  49. + (NSString *)defaultServiceVersion {
  50. return kGDataYouTubeDefaultServiceVersion;
  51. }
  52. #pragma mark -
  53. - (GDataYouTubeRating *)rating {
  54. return [self objectForExtensionClass:[GDataYouTubeRating class]];
  55. }
  56. - (void)setRating:(GDataYouTubeRating *)obj {
  57. [self setObject:obj forExtensionClass:[GDataYouTubeRating class]];
  58. }
  59. @end
  60. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE