PageRenderTime 63ms CodeModel.GetById 27ms app.highlight 31ms RepoModel.GetById 1ms app.codeStats 0ms

/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//
17//  GDataAnalyticsEngagement.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ANALYTICS_SERVICE
21
22#import "GDataAnalyticsEngagement.h"
23#import "GDataAnalyticsConstants.h"
24
25static NSString *const kComparisonAttr = @"comparison";
26static NSString *const kThresholdValue = @"thresholdValue";
27static NSString *const kTypeAttr = @"type";
28
29@implementation GDataAnalyticsEngagement
30
31+ (NSString *)extensionElementURI       { return kGDataNamespaceAnalyticsGA; }
32+ (NSString *)extensionElementPrefix    { return kGDataNamespaceAnalyticsGAPrefix; }
33+ (NSString *)extensionElementLocalName { return @"engagement"; }
34
35- (void)addParseDeclarations {
36
37  NSArray *attrs = [NSArray arrayWithObjects:
38                    kComparisonAttr, kThresholdValue, kTypeAttr, nil];
39
40  [self addLocalAttributeDeclarations:attrs];
41}
42
43#pragma mark -
44
45// Attributes
46
47- (NSString *)comparison {
48  return [self stringValueForAttribute:kComparisonAttr];
49}
50
51- (void)setComparison:(NSString *)str {
52  [self setStringValue:str forAttribute:kComparisonAttr];
53}
54
55- (NSNumber *)thresholdValue {
56  return [self longLongNumberForAttribute:kThresholdValue];
57}
58
59- (void)setThresholdValue:(NSNumber *)num {
60  [self setStringValue:[num stringValue] forAttribute:kThresholdValue];
61}
62
63- (NSString *)type {
64  return [self stringValueForAttribute:kTypeAttr];
65}
66
67- (void)setType:(NSString *)str {
68  [self setStringValue:str forAttribute:kTypeAttr];
69}
70
71@end
72
73#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ANALYTICS_SERVICE