From f23b0b21c55ef8bc22a4960f59b0e7246f6d4d03 Mon Sep 17 00:00:00 2001 From: zen Date: Wed, 3 Dec 2014 15:08:01 +0200 Subject: [PATCH] [fix] typo --- FastEasyMapping/Source/Core/Mapping/FEMMapping.h | 4 ++-- FastEasyMapping/Source/Core/Mapping/FEMMapping.m | 4 ++-- .../Mapping Provider/MappingProvider.m | 16 ++++++++-------- .../Mapping Provider/MappingProviderNative.m | 6 +++--- .../Specs/FEMObjectMappingSpec.m | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/FastEasyMapping/Source/Core/Mapping/FEMMapping.h b/FastEasyMapping/Source/Core/Mapping/FEMMapping.h index f115d58..9d9233e 100644 --- a/FastEasyMapping/Source/Core/Mapping/FEMMapping.h +++ b/FastEasyMapping/Source/Core/Mapping/FEMMapping.h @@ -29,7 +29,7 @@ @interface FEMMapping (Shortcut) - (void)addAttributesFromArray:(NSArray *)attributes; -- (void)addAttributesDictionary:(NSDictionary *)attributesToKeyPath; +- (void)addAttributesFromDictionary:(NSDictionary *)attributesToKeyPath; - (void)addAttributeWithProperty:(NSString *)property keyPath:(NSString *)keyPath; - (void)addRelationshipMapping:(FEMMapping *)mapping forProperty:(NSString *)property keyPath:(NSString *)keyPath; @@ -42,7 +42,7 @@ @interface FEMMapping (Deprecated) - (void)addAttributeMappingFromArray:(NSArray *)attributes __attribute__((deprecated("will become obsolete in 0.6.0; use -[FEMMapping addAttributesFromArray:] instead"))); -- (void)addAttributeMappingDictionary:(NSDictionary *)attributesToKeyPath __attribute__((deprecated("will become obsolete in 0.6.0; use -[FEMMapping addAttributesDictionary:] instead"))); +- (void)addAttributeMappingDictionary:(NSDictionary *)attributesToKeyPath __attribute__((deprecated("will become obsolete in 0.6.0; use -[FEMMapping addAttributesFromDictionary:] instead"))); - (void)addAttributeMappingOfProperty:(NSString *)property atKeypath:(NSString *)keypath __attribute__((deprecated("will become obsolete in 0.6.0; use -[FEMMapping addAttributeWithProperty:keyPath:] instead"))); @property (nonatomic, strong, readonly) NSArray *attributeMappings __attribute__((deprecated("will become obsolete in 0.6.0; use -[FEMMapping attributes] instead"))); diff --git a/FastEasyMapping/Source/Core/Mapping/FEMMapping.m b/FastEasyMapping/Source/Core/Mapping/FEMMapping.m index 3910661..a439b72 100644 --- a/FastEasyMapping/Source/Core/Mapping/FEMMapping.m +++ b/FastEasyMapping/Source/Core/Mapping/FEMMapping.m @@ -102,7 +102,7 @@ - (NSString *)description { @implementation FEMMapping (Shortcut) -- (void)addAttributesDictionary:(NSDictionary *)attributesToKeyPath { +- (void)addAttributesFromDictionary:(NSDictionary *)attributesToKeyPath { [attributesToKeyPath enumerateKeysAndObjectsUsingBlock:^(id attribute, id keyPath, BOOL *stop) { [self addAttribute:[FEMAttribute mappingOfProperty:attribute toKeyPath:keyPath]]; }]; @@ -146,7 +146,7 @@ - (void)addAttributeMappingFromArray:(NSArray *)attributes { } - (void)addAttributeMappingDictionary:(NSDictionary *)attributesToKeyPath { - [self addAttributesDictionary:attributesToKeyPath]; + [self addAttributesFromDictionary:attributesToKeyPath]; } - (void)addAttributeMappingOfProperty:(NSString *)property atKeypath:(NSString *)keypath { diff --git a/FastEasyMappingTests/Mapping Provider/MappingProvider.m b/FastEasyMappingTests/Mapping Provider/MappingProvider.m index 2788989..dbd7f23 100644 --- a/FastEasyMappingTests/Mapping Provider/MappingProvider.m +++ b/FastEasyMappingTests/Mapping Provider/MappingProvider.m @@ -14,7 +14,7 @@ @implementation MappingProvider + (FEMManagedObjectMapping *)carMappingWithPrimaryKey { FEMManagedObjectMapping *mapping = [self carMapping]; [mapping setPrimaryKey:@"carID"]; - [mapping addAttributesDictionary:@{@"carID" : @"id"}]; + [mapping addAttributesFromDictionary:@{@"carID" : @"id"}]; return mapping; } @@ -30,7 +30,7 @@ + (FEMManagedObjectMapping *)carWithRootKeyMapping { rootPath:@"car" configuration:^(FEMManagedObjectMapping *mapping) { // [mapping setPrimaryKey:@"carID"]; - [mapping addAttributesDictionary:@{@"carID" : @"id"}]; + [mapping addAttributesFromDictionary:@{@"carID" : @"id"}]; [mapping addAttributesFromArray:@[@"model", @"year"]]; }]; } @@ -38,7 +38,7 @@ + (FEMManagedObjectMapping *)carWithRootKeyMapping { + (FEMManagedObjectMapping *)carNestedAttributesMapping { return [FEMManagedObjectMapping mappingForEntityName:@"Car" configuration:^(FEMManagedObjectMapping *mapping) { // [mapping setPrimaryKey:@"carID"]; - [mapping addAttributesDictionary:@{@"carID" : @"id", @"year" : @"information.year"}]; + [mapping addAttributesFromDictionary:@{@"carID" : @"id", @"year" : @"information.year"}]; [mapping addAttributesFromArray:@[@"model"]]; }]; } @@ -46,7 +46,7 @@ + (FEMManagedObjectMapping *)carNestedAttributesMapping { + (FEMManagedObjectMapping *)carWithDateMapping { return [FEMManagedObjectMapping mappingForEntityName:@"Car" configuration:^(FEMManagedObjectMapping *mapping) { // [mapping setPrimaryKey:@"carID"]; - [mapping addAttributesDictionary:@{@"carID" : @"id"}]; + [mapping addAttributesFromDictionary:@{@"carID" : @"id"}]; [mapping addAttributesFromArray:@[@"model", @"year"]]; [mapping addAttribute:[FEMAttribute mappingOfProperty:@"createdAt" toKeyPath:@"created_at" @@ -57,7 +57,7 @@ + (FEMManagedObjectMapping *)carWithDateMapping { + (FEMManagedObjectMapping *)phoneMapping { return [FEMManagedObjectMapping mappingForEntityName:@"Phone" configuration:^(FEMManagedObjectMapping *mapping) { // [mapping setPrimaryKey:@"phoneID"]; - [mapping addAttributesDictionary:@{@"phoneID" : @"id"}]; + [mapping addAttributesFromDictionary:@{@"phoneID" : @"id"}]; [mapping addAttributesFromArray:@[@"number", @"ddd", @"ddi"]]; }]; } @@ -65,7 +65,7 @@ + (FEMManagedObjectMapping *)phoneMapping { + (FEMManagedObjectMapping *)personMapping { return [FEMManagedObjectMapping mappingForEntityName:@"Person" configuration:^(FEMManagedObjectMapping *mapping) { // [mapping setPrimaryKey:@"personID"]; - [mapping addAttributesDictionary:@{@"personID" : @"id"}]; + [mapping addAttributesFromDictionary:@{@"personID" : @"id"}]; [mapping addAttributesFromArray:@[@"name", @"email", @"gender"]]; [mapping addRelationship:[FEMRelationship mappingOfProperty:@"car" configuration:^(FEMRelationship *relationshipMapping) { @@ -84,7 +84,7 @@ + (FEMManagedObjectMapping *)personMapping { + (FEMManagedObjectMapping *)personWithPhoneMapping { return [FEMManagedObjectMapping mappingForEntityName:@"Person" configuration:^(FEMManagedObjectMapping *mapping) { [mapping setPrimaryKey:@"personID"]; - [mapping addAttributesDictionary:@{@"personID" : @"id"}]; + [mapping addAttributesFromDictionary:@{@"personID" : @"id"}]; [mapping addAttributesFromArray:@[@"name", @"email", @"gender"]]; [mapping addRelationship:[FEMRelationship mappingOfProperty:@"phones" @@ -101,7 +101,7 @@ + (FEMManagedObjectMapping *)personWithPhoneMapping { + (FEMManagedObjectMapping *)personWithCarMapping { return [FEMManagedObjectMapping mappingForEntityName:@"Person" configuration:^(FEMManagedObjectMapping *mapping) { [mapping setPrimaryKey:@"personID"]; - [mapping addAttributesDictionary:@{@"personID" : @"id"}]; + [mapping addAttributesFromDictionary:@{@"personID" : @"id"}]; [mapping addAttributesFromArray:@[@"name", @"email"]]; [mapping addRelationship:[FEMRelationship mappingOfProperty:@"car" configuration:^(FEMRelationship *relationshipMapping) { diff --git a/FastEasyMappingTests/Mapping Provider/MappingProviderNative.m b/FastEasyMappingTests/Mapping Provider/MappingProviderNative.m index 872347f..321a41a 100644 --- a/FastEasyMappingTests/Mapping Provider/MappingProviderNative.m +++ b/FastEasyMappingTests/Mapping Provider/MappingProviderNative.m @@ -34,7 +34,7 @@ + (FEMObjectMapping *)carWithRootKeyMapping { + (FEMObjectMapping *)carNestedAttributesMapping { return [FEMObjectMapping mappingForClass:[CarNative class] configuration:^(FEMObjectMapping *mapping) { [mapping addAttributesFromArray:@[@"model"]]; - [mapping addAttributesDictionary:@{ + [mapping addAttributesFromDictionary:@{ @"year" : @"information.year" }]; }]; @@ -52,7 +52,7 @@ + (FEMObjectMapping *)carWithDateMapping { + (FEMObjectMapping *)phoneMapping { return [FEMObjectMapping mappingForClass:[PhoneNative class] configuration:^(FEMObjectMapping *mapping) { [mapping addAttributesFromArray:@[@"number"]]; - [mapping addAttributesDictionary:@{ + [mapping addAttributesFromDictionary:@{ @"DDI" : @"ddi", @"DDD" : @"ddd", }]; @@ -157,7 +157,7 @@ + (FEMObjectMapping *)nativeMappingWithNullPropertie { + (FEMObjectMapping *)planeMapping { return [FEMObjectMapping mappingForClass:[PlaneNative class] configuration:^(FEMObjectMapping *mapping) { - [mapping addAttributesDictionary:@{@"flightNumber" : @"flight_number"}]; + [mapping addAttributesFromDictionary:@{@"flightNumber" : @"flight_number"}]; [mapping addToManyRelationshipMapping:[self personMapping] forProperty:@"persons" keyPath:@"persons"]; }]; } diff --git a/FastEasyMappingTests/Specs/FEMObjectMappingSpec.m b/FastEasyMappingTests/Specs/FEMObjectMappingSpec.m index 02eb3ef..f842a44 100644 --- a/FastEasyMappingTests/Specs/FEMObjectMappingSpec.m +++ b/FastEasyMappingTests/Specs/FEMObjectMappingSpec.m @@ -172,7 +172,7 @@ beforeEach(^{ mapping = [[FEMObjectMapping alloc] initWithObjectClass:[CarNative class]]; - [mapping addAttributesDictionary:@{ + [mapping addAttributesFromDictionary:@{ @"identifier" : @"id", @"email" : @"contact.email" }];