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

http://macfuse.googlecode.com/ · Objective C · 73 lines · 36 code · 19 blank · 18 comment · 1 complexity · d33b79ecfa51c4eebc49f7803597f5ee 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. // GDataAnalyticsEngagement.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ANALYTICS_SERVICE
  19. #import "GDataAnalyticsEngagement.h"
  20. #import "GDataAnalyticsConstants.h"
  21. static NSString *const kComparisonAttr = @"comparison";
  22. static NSString *const kThresholdValue = @"thresholdValue";
  23. static NSString *const kTypeAttr = @"type";
  24. @implementation GDataAnalyticsEngagement
  25. + (NSString *)extensionElementURI { return kGDataNamespaceAnalyticsGA; }
  26. + (NSString *)extensionElementPrefix { return kGDataNamespaceAnalyticsGAPrefix; }
  27. + (NSString *)extensionElementLocalName { return @"engagement"; }
  28. - (void)addParseDeclarations {
  29. NSArray *attrs = [NSArray arrayWithObjects:
  30. kComparisonAttr, kThresholdValue, kTypeAttr, nil];
  31. [self addLocalAttributeDeclarations:attrs];
  32. }
  33. #pragma mark -
  34. // Attributes
  35. - (NSString *)comparison {
  36. return [self stringValueForAttribute:kComparisonAttr];
  37. }
  38. - (void)setComparison:(NSString *)str {
  39. [self setStringValue:str forAttribute:kComparisonAttr];
  40. }
  41. - (NSNumber *)thresholdValue {
  42. return [self longLongNumberForAttribute:kThresholdValue];
  43. }
  44. - (void)setThresholdValue:(NSNumber *)num {
  45. [self setStringValue:[num stringValue] forAttribute:kThresholdValue];
  46. }
  47. - (NSString *)type {
  48. return [self stringValueForAttribute:kTypeAttr];
  49. }
  50. - (void)setType:(NSString *)str {
  51. [self setStringValue:str forAttribute:kTypeAttr];
  52. }
  53. @end
  54. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ANALYTICS_SERVICE