/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Analytics/GDataAnalyticsCustomVariable.m

http://macfuse.googlecode.com/ · Objective C · 73 lines · 39 code · 17 blank · 17 comment · 1 complexity · 64ccce17aa9f531a26b12d08872c645f MD5 · raw file

  1. /* Copyright (c) 2009 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. // GDataAnalyticsCustomVariable.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ANALYTICS_SERVICE
  19. #import "GDataAnalyticsCustomVariable.h"
  20. #import "GDataAnalyticsConstants.h"
  21. static NSString *const kIndexAttr = @"index";
  22. static NSString *const kNameAttr = @"name";
  23. static NSString *const kScopeAttr = @"scope";
  24. @implementation GDataAnalyticsCustomVariable
  25. + (NSString *)extensionElementURI { return kGDataNamespaceAnalyticsGA; }
  26. + (NSString *)extensionElementPrefix { return kGDataNamespaceAnalyticsGAPrefix; }
  27. + (NSString *)extensionElementLocalName { return @"customVariable"; }
  28. - (void)addParseDeclarations {
  29. NSArray *attrs = [NSArray arrayWithObjects:
  30. kIndexAttr, kNameAttr, kScopeAttr, nil];
  31. [self addLocalAttributeDeclarations:attrs];
  32. }
  33. #pragma mark -
  34. - (NSNumber *)index {
  35. NSNumber *num = [self intNumberForAttribute:kIndexAttr];
  36. return num;
  37. }
  38. - (void)setIndex:(NSNumber *)num {
  39. [self setStringValue:[num stringValue] forAttribute:kIndexAttr];
  40. }
  41. - (NSString *)name {
  42. NSString *str = [self stringValueForAttribute:kNameAttr];
  43. return str;
  44. }
  45. - (void)setName:(NSString *)str {
  46. [self setStringValue:str forAttribute:kNameAttr];
  47. }
  48. - (NSString *)scope {
  49. NSString *str = [self stringValueForAttribute:kScopeAttr];
  50. return str;
  51. }
  52. - (void)setScope:(NSString *)str {
  53. [self setStringValue:str forAttribute:kScopeAttr];
  54. }
  55. @end
  56. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ANALYTICS_SERVICE