aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/API/FIRDocumentSnapshot.m
diff options
context:
space:
mode:
authorGravatar Sebastian Schmidt <mrschmidt@google.com>2017-12-07 15:53:54 -0800
committerGravatar Sebastian Schmidt <mrschmidt@google.com>2017-12-07 16:03:40 -0800
commit904a141217d6ab84f1759dc504a9329bd74adf68 (patch)
treef4ea1924309bc3b718cd5b4ff759f7d04fb34184 /Firestore/Source/API/FIRDocumentSnapshot.m
parenta8948ced263e7d3ce870dff47cf7c29b12806247 (diff)
Addressing all review comments
Diffstat (limited to 'Firestore/Source/API/FIRDocumentSnapshot.m')
-rw-r--r--Firestore/Source/API/FIRDocumentSnapshot.m18
1 files changed, 2 insertions, 16 deletions
diff --git a/Firestore/Source/API/FIRDocumentSnapshot.m b/Firestore/Source/API/FIRDocumentSnapshot.m
index 0d60033..e4e75c6 100644
--- a/Firestore/Source/API/FIRDocumentSnapshot.m
+++ b/Firestore/Source/API/FIRDocumentSnapshot.m
@@ -116,7 +116,7 @@ NS_ASSUME_NONNULL_BEGIN
}
return [self convertedObject:[self.internalDocument data]
- options:[self convertedSnapshotOptions:options]];
+ options:[FSTFieldValueOptions fieldValueOptions:options]];
}
- (nullable id)valueForField:(id)field {
@@ -135,7 +135,7 @@ NS_ASSUME_NONNULL_BEGIN
}
FSTFieldValue *fieldValue = [[self.internalDocument data] valueForPath:fieldPath.internalValue];
- return [self convertedValue:fieldValue options:[self convertedSnapshotOptions:options]];
+ return [self convertedValue:fieldValue options:[FSTFieldValueOptions fieldValueOptions:options]];
}
- (nullable id)objectForKeyedSubscript:(id)key {
@@ -187,20 +187,6 @@ NS_ASSUME_NONNULL_BEGIN
return result;
}
-/** Create a field value option from a snapshot option. */
-- (FSTFieldValueOptions *)convertedSnapshotOptions:(FIRSnapshotOptions *)snapshotOptions {
- switch (snapshotOptions.serverTimestampBehavior) {
- case FIRServerTimestampBehaviorEstimate:
- return [[FSTFieldValueOptions alloc]
- initWithServerTimestampBehavior:FSTServerTimestampBehaviorEstimate];
- case FIRServerTimestampBehaviorPrevious:
- return [[FSTFieldValueOptions alloc]
- initWithServerTimestampBehavior:FSTServerTimestampBehaviorPrevious];
- default:
- return [FSTFieldValueOptions defaultOptions];
- }
-}
-
@end
NS_ASSUME_NONNULL_END